Skip to content

Instantly share code, notes, and snippets.

@J7mbo
Created February 22, 2019 12:14
Show Gist options
  • Save J7mbo/ee7779e87f96c8475f1bff97e38b6829 to your computer and use it in GitHub Desktop.
Save J7mbo/ee7779e87f96c8475f1bff97e38b6829 to your computer and use it in GitHub Desktop.
golang-constructors-blog-15
type consumer struct { }
func NewConsumer() *consumer {
return &consumer{}
}
func (*consumer) DoSomething(obj interfaceToConsume) {
/* We can actually pass in a Package1.myStruct here! */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment