L := lua.NewState() lua.LString("hello").Push(L) v1 := lua.Pop(L).(lua.LString) // v1 = "hello"
L := lua.NewState() lua.LString("hello").Push(L) lua.LString("world").Push(L) v1 := lua.Pop(L).(lua.LString) // v1 = "world" v2 := lua.Pop(L).(lua.LString) // v2 = "hello"In this example, two strings are pushed onto the Lua stack in succession. Using Pop twice, the strings are popped off the stack in reverse order and assigned to variables v1 and v2. Package library: github.com/aarzilli/golua/lua. subpackage: github.com/aarzilli/golua/lua/State