mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
Conversion of interp func into runtime func already worked, but added a test anyway to watch out for regressions. Fixes #941
18 lines
210 B
Go
18 lines
210 B
Go
package main
|
|
|
|
import "strconv"
|
|
|
|
type atoidef func(s string) (int, error)
|
|
|
|
func main() {
|
|
stdatoi := atoidef(strconv.Atoi)
|
|
n, err := stdatoi("7")
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
println(n)
|
|
}
|
|
|
|
// Output:
|
|
// 7
|