//
pkg.gl
Category
github.com/mrdulin/golang
src
26-oop-in-go
02-New-function-instead-of-constructors
employee
package
0.0.0-20201029044842-3e3f2e86f1ee
Repository:
https://github.com/mrdulin/golang.git
Documentation:
pkg.go.dev
Overview
Versions
1
Dependencies
1
Dependents
1
Files
11 SLOC
#
Functions
New
New 一般使用New函数作为类似Java中constructor, 如果一个package中只有一个struct,用New函数,如果有多个struct,则用NewT命名,例如NewEmployee.