Replace encoding/json with github.com/buger/jsonparser #41
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
:)