We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test.lua:
root = {} function root:testfunc(a) if a == nil then return "nil" end return a end
main.go
lua.NewState() defer L.Close() if err := L.DoFile("test.lua"} myTable := L.GetGlobal("root").(*lua.LTable) err := L.CallByParam(lua.P{ Fn: myTable.RawGet(lua.LString("testfunc")), NRet: 1, Protect: true, }, lua.LString("hello")) if err != nil { panic(err) } ret := L.Get(-1) L.Pop(1) res, ok := ret.(lua.LString) if ok { fmt.Println(res) }
The text was updated successfully, but these errors were encountered:
fixed
Sorry, something went wrong.
This issue looks to be caused by you not passing a self parameter in your CallByParam invocation. I think if you were to do:
self
CallByParam
err := L.CallByParam(lua.P{ Fn: myTable.RawGet(lua.LString("testfunc")), NRet: 1, Protect: true, }, myTable, lua.LString("hello"))
It would work as expected.
If you agree, please consider closing the issue.
No branches or pull requests
test.lua:
main.go
The text was updated successfully, but these errors were encountered: