DecodeArray reads the next JSON-encoded value from the decoder's input (io.Reader) and stores it in the value pointed to by v. v must implement UnmarshalerJSONArray. See the documentation for Unmarshal for details about the conversion of JSON into a Go value.
(v UnmarshalerJSONArray)
| 9 | // |
| 10 | // See the documentation for Unmarshal for details about the conversion of JSON into a Go value. |
| 11 | func (dec *Decoder) DecodeArray(v UnmarshalerJSONArray) error { |
| 12 | if dec.isPooled == 1 { |
| 13 | panic(InvalidUsagePooledDecoderError("Invalid usage of pooled decoder")) |
| 14 | } |
| 15 | _, err := dec.decodeArray(v) |
| 16 | return err |
| 17 | } |
| 18 | func (dec *Decoder) decodeArray(arr UnmarshalerJSONArray) (int, error) { |
| 19 | // remember last array index in case of nested arrays |
| 20 | lastArrayIndex := dec.arrayIndex |