github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/struct22.gno (about) 1 package main 2 3 type S struct { 4 Child *S 5 Name string 6 } 7 8 func main() { 9 s := &S{Name: "root"} 10 s.Child = &S{Name: "child"} 11 println(s.Child.Name) 12 } 13 14 // Output: 15 // child