Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumGostruct embedding and promotionSingle-choice MCQ

Given the embedding below, what does d.Greet() print?

type Animal struct{} func (Animal) Greet() string { return "Hi from Animal" } type Dog struct{ Animal } func (Dog) Greet() string { return "Hi from Dog" } func main() { d := Dog{} fmt.Println(d.Greet()) }