go.lang的新手,我进行了搜索,这两个(人/人)有什么区别?
type Person struct {
Name string
Age int
}
type People []struct {
Person
}
func main() {
person := Person{Name: "a", Age: 1}
var people People
people = append(people, person)
// throws: cannot use person (type Person) as type struct { Person } in append
var peoples []Person
peoples = append(peoples, person)
}