Hi. I doubt you actually want to merge this PR, so this is more of an FYI. My goal in working with ios_system and a-shell has been to get this working as a wasm binary. To achieve that I wanted to compile it with tinygo, which seems to be the easiest and most functional way to get wasm binaries with Go.
Unfortunately, encoding/json does not work with tinygo because tinygo does not have a complete implementation of reflect. It looks like that is a work in progress, but it's still a big challenge to tackle.
I found jsonparser, which appeared to both offer everything that's needed and also does not require the reflect package. It also does not need to unmarshal to a struct like other packages, which I found do not usually support map[string]interface{} as a target.
Anyway, after making these changes I can compile with:
Also, I'm not sure if this is standard with go test, but I found that running go test on this project masked stderr, which would have helped me tremendously in resolving one of the test cases.
Hi. I doubt you actually want to merge this PR, so this is more of an FYI. My goal in working with
ios_system
anda-shell
has been to get this working as awasm
binary. To achieve that I wanted to compile it withtinygo
, which seems to be the easiest and most functional way to getwasm
binaries with Go.Unfortunately,
encoding/json
does not work withtinygo
becausetinygo
does not have a complete implementation ofreflect
. It looks like that is a work in progress, but it's still a big challenge to tackle.I found
jsonparser
, which appeared to both offer everything that's needed and also does not require thereflect
package. It also does not need to unmarshal to a struct like other packages, which I found do not usually supportmap[string]interface{}
as a target.Anyway, after making these changes I can compile with:
tinygo build -no-debug -o json2csv.wasm -target wasi .
then download the
wasm
toa-shell
'sDocuments/bin
folder, and it works there on the iPhone / iPad just like theamd64
binary does on my iMac.Both the
amd64
andwasm
versions passgo test
:)