Conversion from Lua table to JSON fails because of gluamapper
linkerlin opened this issue · 8 comments
linkerlin commented
I have read the code , and I find :
// Convert the Lua table to a map that can be used when converting to JSON (map[string]interface{})
mapinterface := gluamapper.ToGoValue(table, gluamapper.Option{
NameFunc: func(s string) string {
return s
},
})
NOTICE that:
to JSON (map[string]interface{})
In the early ,the REPL report:
ERRO[0356] json: unsupported type: map[interface {}]interface {}
linkerlin commented
linkerlin commented
xyproto commented
Thanks for reporting, I'm able to reproduce the issue.
xyproto commented
Thanks! Reverting 86c3a7c and applying the patch worked.
However, I already had a fork of gluamapper + gopher-lua that had the suggested changes, so I just switched (back) to those. They were removed some time ago because I mistakenly thought that they were no longer needed.
These two now works again, in main
:
json {a=1}
json {a={b=100}}
Thanks for reporting and patching!
tooolbox commented
xyproto commented
Good suggestion. This should be feasable, either with go test
or by fetching the result from Algernon with curl
at test time.