Files
moxa/_test/composite8.go
2020-04-16 12:24:04 +02:00

17 lines
187 B
Go

package main
type T struct{ I int }
func main() {
t := []*T{}
s := []int{1, 2}
for _, e := range s {
x := &T{e}
t = append(t, x)
}
println(t[0].I, t[1].I)
}
// Output:
// 1 2