You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Handling Json with TinyGo is not straight forward (but not impossible).
If your use case is very simple (a Json string without nested object or array) you can use:
flatjson.StrToMap(flatJsonStr string) map[string]interface{}: get a flat json string (no nested obj) and return a map
flatjson.MapToStr(jsonMap map[string]interface{}) string: get a flat json map and return a json string
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Handling Json with TinyGo is not straight forward (but not impossible).
If your use case is very simple (a Json string without nested object or array) you can use:
flatjson.StrToMap(flatJsonStr string) map[string]interface{}
: get a flat json string (no nested obj) and return a mapflatjson.MapToStr(jsonMap map[string]interface{}) string
: get a flat json map and return a json stringExample:
Call the function:
This discussion was created from the release v0.2.4 馃 [lizard] "flatjson".
Beta Was this translation helpful? Give feedback.
All reactions