package main
import "fmt"
type Animal struct {
Age int
Weight float32
}
func (a *Animal) Show1() {
fmt.Printf("我是show1 我的年龄是:%v,我的体重是:%v", a.Age, a.Weight)
}
type Cat struct {
Animal
Age int
int
}
func (c *Cat) GetCat() {
fmt.Println("GetCat")
}
// 定义老师的结构体
func main() {
c := &Cat{}
c.Animal.Age = 1
c.Animal.Weight = 2
c.int = 9
c.Show1()
c.GetCat()
fmt.Println(c.int)
}