package main
import "fmt"
type cat struct {
color string
gender byte
age int
}
func (d cat) say() {
fmt.Println(d.color, d.gender, d.age) //可用:fmt.Printf("%s %d %d", d.color, d.gender, d.age)
}
func main() {
var b cat
b.color = "yellow"
b.say()
}
yellow 0 0