github.com/traefik/yaegi@v0.15.1/_test/a10.go (about)

     1  package main
     2  
     3  type Sample struct {
     4  	Name string
     5  }
     6  
     7  var samples = []Sample{}
     8  
     9  func f(i int) {
    10  	println(samples[i].Name)
    11  }
    12  
    13  func main() {
    14  	samples = append(samples, Sample{Name: "test"})
    15  	f(0)
    16  }
    17  
    18  // Output:
    19  // test