// Chapter 29 example: this file does not compile, on purpose. A dog embeds an // animal, but a dog is not an animal. Run it, read the error, then change the // call to show(rex.animal). // // Run with: go run exercises/29/02-not-a-parent.go package main import "fmt" type animal struct { name string } type dog struct { animal } func show(a animal) { fmt.Println("Animal:", a.name) } func main() { rex := dog{animal: animal{name: "Rex"}} show(rex) }