github.com/neugram/ng@v0.0.0-20180309130942-d472ff93d872/eval/testdata/ellipsis.ng (about)

     1  total := 0
     2  
     3  func f(x int, y ...int) {
     4  	total += x
     5  	for _, v := range y {
     6  		total += v
     7  	}
     8  }
     9  ints := []int{3, 4, 5}
    10  f(2, ints...)
    11  f(1)
    12  f(1, 1, 2)
    13  
    14  if total == 19 {
    15  	print("OK")
    16  }