You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import...// I have imported all the package under the "$GOPATH/src/__python__" and thus "json" related libs should be importedfuncmain() {
f:=grumpy.NewRootFrame()
mods, _:=grumpy.ImportModule(f, "feature1")
fmt.Printf("mods: %v\n", mods)
feature1, _:=grumpy.GetAttr(f, mods[0], grumpy.NewStr("feature1"), nil)
args:=f.MakeArgs(1)
args[0] =grumpy.NewStr(`{"a": 1, "b": "I am string"}`).ToObject()
result, err:=feature1.Call(f, args, nil)
fmt.Printf("result type: %v\n", reflect.TypeOf(result))
fmt.Printf("result: %v\n", result.String())
fmt.Printf("err: %v\n", err)
}
When I tried to run the go main code, and I got result like this
result: nil
err: TypeError('bad operand type for unary -: \'tuple\'',)
I found this error is raised from grumpy.ImportModule function in generated go code feature1.go but I am not clear how this error is raised. Also when I try to import some other python std libs like "sys", and it works fine.
My Golang version is go1.10.3 darwin/amd64
The text was updated successfully, but these errors were encountered:
google#408 opened by @always-less on Jul 30
My python code is as below
and the go main code is as below
When I tried to run the go main code, and I got result like this
I found this error is raised from grumpy.ImportModule function in generated go code feature1.go but I am not clear how this error is raised. Also when I try to import some other python std libs like "sys", and it works fine.
My Golang version is go1.10.3 darwin/amd64
The text was updated successfully, but these errors were encountered: