Skip to content

Instantly share code, notes, and snippets.

@J7mbo
Created February 22, 2019 12:13
Show Gist options
  • Save J7mbo/e31e2c3b6971ab39406ae739bd75f8ef to your computer and use it in GitHub Desktop.
Save J7mbo/e31e2c3b6971ab39406ae739bd75f8ef to your computer and use it in GitHub Desktop.
golang-constructors-blog-13
package Package1
type myStruct struct { }
func (*myStruct) SomeFunc() int { return 42 }
func (*myStruct) SomeOtherFunc() string { return "42" }
/* Factory */
func NewMyStruct() *myStruct {
return &myStruct{}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment