企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
``` package main import "fmt" type Person struct {     Name string     age  int } type son struct {     mother string     father string } type student struct {     Person     son     Name string     id string } func (p *Person) String() {     fmt.Printf("Name:%s\tAge:%d\n", p.Name, p.age) } func (p *student) String() {     fmt.Printf("student Name:%s\t home Name:%s\t Age:%d\n", p.Name, p.Person.Name, p.age) } func main() {     p := &student{}     p.Name = "tom"     p.Person.Name = "tom1"     p.Person.String()     p.String() } ``` Name:tom1 Age:0 student Name:tom home Name:tom1 Age:0