gitlab.com/ethan.reesor/vscode-notebooks/yaegi@v0.0.0-20220417214422-5c573557938e/_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