github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/composite8bis.gno (about) 1 package main 2 3 type T struct{ I int } 4 5 func main() { 6 t := []*T{} 7 s := []int{1, 2} 8 for _, e := range s { 9 x := &T{I: e} 10 t = append(t, x) 11 } 12 println(t[0].I, t[1].I) 13 } 14 15 // Output: 16 // 1 2