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

     1  package main
     2  
     3  import "strconv"
     4  
     5  type atoidef func(s string) (int, error)
     6  
     7  func main() {
     8  	stdatoi := atoidef(strconv.Atoi)
     9  	n, err := stdatoi("7")
    10  	if err != nil {
    11  		panic(err)
    12  	}
    13  	println(n)
    14  }
    15  
    16  // Output:
    17  // 7