Closed AlpJQ closed 1 year ago
Your provided input is not a valid json
- `[{"a":1, "b":2},{"a":0, "b":3},]`
+ `[{"a":1, "b":2},{"a":0, "b":3}]`
OrderedMap will unmarshal the same way a map does. In this case @gkampitakis is correct, the error would be invalid character ']' looking for beginning of value
. To reproduce:
b := []byte(`[{"a":1, "b":2},{"a":0, "b":3},]`)
m := []map[string]int{}
err := json.Unmarshal(b, &m)
The error for unmarshal to map
is the same as the error for OrderedMap
, which is expected.
however, it does not work