github.com/HaHadaxigua/yaegi@v1.0.1/_test/variadic5.go (about)

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