-
Notifications
You must be signed in to change notification settings - Fork 78
Closed
Description
Hi!
I have the following JSON structure:
{"d":[{"author":{"displayName":"DemoUser3","id":2},"classes":null,"id":9879,"v":{"code":"","created":"2013-09-19T09:38:50+02:00","published":"0001-01-01T00:00:00Z","updated":"2013-09-19T09:38:50+02:00"}}],"s":200}Objx panics on json.Get("d[0].id").Int(). Test:
json, err := objx.FromJSON(`{"d":[{"author":{"displayName":"DemoUser3","id":2},"classes":null,"id":9879,"v":{"code":"","created":"2013-09-19T09:38:50+02:00","published":"0001-01-01T00:00:00Z","updated":"2013-09-19T09:38:50+02:00"}}],"s":200}`)
if !assert.NoError(t, err, "Can't decode output") {
return
}
assert.Equal(t, json.Get("d[0].id").Int(), 9879, "...") Reactions are currently unavailable