-
Notifications
You must be signed in to change notification settings - Fork 687
Open
Description
- What version of GopherLua are you using? : v1.1.1
- What version of Go are you using? : 1.22.3
- What operating system and processor architecture are you using? : mac-M1
- What did you do? :
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)
}
- What did you expect to see? :"hello"
- What did you see instead? : "nil"
Metadata
Metadata
Assignees
Labels
No labels