-
-
Save itsmontoya/ee731c00c191a73be1fc05713ae2cc43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmpl := l.GetGlobal("Tmpl").(*lua.LTable) | |
fmt.Println("Tmpl?", tmpl) | |
modifiers := tmpl.RawGetString("modifiers").(*lua.LTable) | |
fmt.Println("Modifiers?", modifiers) | |
modifiers.ForEach(func(k, v lua.LValue) { | |
fmt.Println("Modifier?", k, v) | |
}) | |
if err := l.CallByParam(lua.P{ | |
Fn: modifiers.RawGetString("firstName"), | |
NRet: 1, | |
Protect: true, | |
}, lua.LString("josh")); err != nil { | |
panic(err) | |
} | |
ret := l.Get(-1) // returned value | |
l.Pop(1) // remove received value | |
fmt.Println("Ret?", ret) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment