// raise a Lua error from Go code func RaiseError(L *lua.State, msg string) { L.Where(1) pos := L.ToString(-1) L.Pop(1) panic(L.NewError(pos + " " + msg)) }