gitlab.com/ethan.reesor/vscode-notebooks/yaegi@v0.0.0-20220417214422-5c573557938e/_test/a13.go (about) 1 package main 2 3 type T1 struct { 4 num []int 5 } 6 7 func main() { 8 a := T1{[]int{1, 3, 5}} 9 for i, v := range a.num { 10 println(i, v) 11 } 12 } 13 14 // Output: 15 // 0 1 16 // 1 3 17 // 2 5