Skip to content

Instantly share code, notes, and snippets.

@J7mbo
Created February 22, 2019 12:10
Show Gist options
  • Save J7mbo/2a0b55a9ae23b0af5e4ef1c14f2d428e to your computer and use it in GitHub Desktop.
Save J7mbo/2a0b55a9ae23b0af5e4ef1c14f2d428e to your computer and use it in GitHub Desktop.
golang-constructors-blog-9
type MyStruct struct {
/* Note how s.child is not a pointer any more */
child ChildStruct
}
func (s *MyStruct) StructFunc() {
if s.child != nil {
fmt.Println(s.child.num)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment