Created
July 1, 2019 22:46
-
-
Save l0gicgate/1941220fe5d2efaae9ad2f81b36d6cfa to your computer and use it in GitHub Desktop.
This file contains 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
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