DecodeArrayLen decodes array length. Length is -1 when array is nil.
()
| 11 | |
| 12 | // DecodeArrayLen decodes array length. Length is -1 when array is nil. |
| 13 | func (d *Decoder) DecodeArrayLen() (int, error) { |
| 14 | c, err := d.readCode() |
| 15 | if err != nil { |
| 16 | return 0, err |
| 17 | } |
| 18 | return d.arrayLen(c) |
| 19 | } |
| 20 | |
| 21 | func (d *Decoder) arrayLen(c byte) (int, error) { |
| 22 | if c == msgpcode.Nil { |