package main import "fmt" type user struct { id int name string age int } // 结构体方法 func(u user) Per() { fmt.Println(u.name) } func main() { users := user{id: 1, name: "song", age: 18} users.Per() }