LoginSignup
0
0

More than 5 years have passed since last update.

Golang - How to use Constructor?

Last updated at Posted at 2018-12-26
  1. practice used new and return pointer
  2. practice used make and will not return pointer

If you want to use custom func as constructor, you can follow practice rules.

func newFoo() *foo...

or

func makeBoo() Boo...

https://golang.org/doc/effective_go.html#allocation_new
https://stackoverflow.com/questions/18125625/constructors-in-go

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0