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

     1  package main
     2  
     3  import "fmt"
     4  
     5  type A struct {
     6  }
     7  
     8  func (a A) f(vals ...bool) {
     9  	for _, v := range vals {
    10  		fmt.Println(v)
    11  	}
    12  }
    13  func main() {
    14  	bools := []bool{true}
    15  	a := A{}
    16  	a.f(bools...)
    17  }
    18  
    19  // Output:
    20  // true