Skip to content

Instantly share code, notes, and snippets.

@l0gicgate
Created July 1, 2019 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save l0gicgate/1941220fe5d2efaae9ad2f81b36d6cfa to your computer and use it in GitHub Desktop.
Save l0gicgate/1941220fe5d2efaae9ad2f81b36d6cfa to your computer and use it in GitHub Desktop.
package main
type Foo interface {
methodA() string
}
type Bar struct {
Foo
}
func (bar *Bar) methodA() string {
return "foo bar"
}
func (bar *Bar) New() *Bar {
return &Bar{}
}
type Baz struct {
Foo *Foo
}
func main() {
baz := Baz{Bar.New()}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment