github.com/HaHadaxigua/yaegi@v1.0.1/_test/composite8bis.go (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