Files
moxa/_test/struct23.go
2019-07-09 00:08:12 +02:00

16 lines
191 B
Go

package main
type S struct {
Child []*S
Name string
}
func main() {
s := &S{Name: "root"}
s.Child = append(s.Child, &S{Name: "child"})
println(s.Child[0].Name)
}
// Output:
// child