From 4a43b05dae840bd1348e1a24bdb9fbe2707ee906 Mon Sep 17 00:00:00 2001 From: zxh Date: Mon, 17 Aug 2020 16:10:20 +0800 Subject: [PATCH] Fix: compile error. --- .gitignore | 17 +++++++++++++++++ luar.go | 2 +- luar_test.go | 4 ++-- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b867a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +vendor/ + +.idea/ \ No newline at end of file diff --git a/luar.go b/luar.go index aca93e8..c5a4234 100644 --- a/luar.go +++ b/luar.go @@ -45,7 +45,7 @@ func luaToString(L *lua.State, idx int) string { case lua.LUA_TNIL: return "nil" } - return fmt.Sprintf("%s: %p", L.LTypename(idx), L.ToPointer(idx)) + return fmt.Sprintf("%s: %d", L.LTypename(idx), L.ToPointer(idx)) } func luaDesc(L *lua.State, idx int) string { diff --git a/luar_test.go b/luar_test.go index 8927349..dc0895c 100644 --- a/luar_test.go +++ b/luar_test.go @@ -842,7 +842,7 @@ func TestLuaObjectIter(t *testing.T) { wantValues := map[string]float64{"foo": 10, "bar": 20} if !reflect.DeepEqual(values, wantValues) { - t.Errorf("got %q, want %q", keys, wantValues) + t.Errorf("got %q, want %v", keys, wantValues) } checkStack(t, L) @@ -888,7 +888,7 @@ func TestLuaObjectIterMT(t *testing.T) { wantValues := map[string]float64{"foo": 10, "bar": 20} if !reflect.DeepEqual(values, wantValues) { - t.Errorf("got %q, want %q", keys, wantValues) + t.Errorf("got %q, want %v", keys, wantValues) } checkStack(t, L)