harbor run -t openthoughts/tasktrove-swe-rebench-v2-patched-oracle-d5__tengo-292
harbor download openthoughts/tasktrove-swe-rebench-v2-patched-oracle-d5__tengo-292
cd /testbed git clone https://github.com/d5/tengo.git . && git checkout d08a636e7c393c54537dd914c3bbd6ec2d2f700d export DEBIAN_FRONTEND=noninteractive apt-get update -qq apt-get install -y -qq golang export HOME=/root export GOPATH=/root/go export PATH=$PATH:$GOPATH/bin go install golang.org/x/lint/golint@latest
panic: interface conversion: tengo.Object is *tengo.CompiledFunction, not *tengo.String Having two source modules where the one uses the others gives panic.
package main import ( "fmt" "github.com/d5/tengo/v2" "github.com/d5/tengo/v2/stdlib" ) func main() { script := tengo.NewScript([]byte(` module_a := import("module_a") module_b := import("module_b") module_b() `)) mods := stdlib.GetModuleMap("json", "fmt", "math", "times") mods.AddSourceModule("module_a", []byte(` fubar := func(arr, low, n) { i := low + 1 for i < n + 1 { } } module_a := { "fo": func(){} } export module_a `)) mods.AddSourceModule("module_b", []byte( `export func(){ module_a := import("module_a") } `)) script.SetImports(mods) compiledFunc, err := script.Compile() if err != nil { panic(err) } fmt.Println("RUN") err = compiledFunc.Run() if err != nil { panic(err) } }