3 ms·
The fastjson package is fast. Can't disagree but unfortunately it accepts invalid JSON and what you get from the parser is a Value that you can get values from
by peterohler 6y ago
The fastjson package is fast. Can't disagree but unfortunately it accepts invalid JSON and what you get from the parser is a Value that you can get values from using a Get() function and not a simple go type. To get a simple go type like []interface{} or map[string]interface{} you have to know what the paths are. You can't actually iterate over a map as far as I can tell.
Basically the two packages are different in what they provide. OjG returns simple go types and instead of a simple Get() it provides a full JSONPath implementation. Different but both have their uses so depending on a user's needed one might be better than the other.