Explain, please, why in the second case the phone name is not displayed?

package main import ( "fmt" ) type Person struct { Name string } func (p *Person) Talk() { fmt.Println("Привет, моё имя", p.Name) } type Android struct { Person Model string } func main() { alex := Person{Name: "Dima"} alex.Talk() //mobile := new(Android) mobile := new(Android) mobile.Model = "Asus" mobile.Talk() } 
  • @ misha99; If you are given an exhaustive answer, mark it as correct (click on the check mark next to the selected answer). - Vitalina

1 answer 1

Because you assign the name of the variable Model , and need Name .