mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
17 lines
187 B
Go
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
|