Created
February 22, 2019 12:06
-
-
Save J7mbo/d34f9c86c2b96d122b738a9da857c450 to your computer and use it in GitHub Desktop.
golang-constructors-blog-4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Yep, now it's private because of the lower-cased 'm' */ | |
type myStruct struct { | |
num int | |
} | |
func NewMyStruct() *myStruct { | |
return &myStruct{num: 42} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment