mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
17 lines
233 B
Go
17 lines
233 B
Go
package main
|
|
|
|
type Node struct {
|
|
Name string
|
|
Alias *Node
|
|
Child []*Node
|
|
}
|
|
|
|
func main() {
|
|
n := &Node{Name: "parent"}
|
|
n.Child = append(n.Child, &Node{Name: "child"})
|
|
println(n.Name, n.Child[0].Name)
|
|
}
|
|
|
|
// Output:
|
|
// parent child
|