(c byte)
| 76 | } |
| 77 | |
| 78 | func (d *Decoder) mapLen(c byte) (int, error) { |
| 79 | if c == msgpcode.Nil { |
| 80 | return -1, nil |
| 81 | } |
| 82 | if c >= msgpcode.FixedMapLow && c <= msgpcode.FixedMapHigh { |
| 83 | return int(c & msgpcode.FixedMapMask), nil |
| 84 | } |
| 85 | if c == msgpcode.Map16 { |
| 86 | size, err := d.uint16() |
| 87 | return int(size), err |
| 88 | } |
| 89 | if c == msgpcode.Map32 { |
| 90 | size, err := d.uint32() |
| 91 | return int(size), err |
| 92 | } |
| 93 | return 0, unexpectedCodeError{code: c, hint: "map length"} |
| 94 | } |
| 95 | |
| 96 | func decodeMapStringStringValue(d *Decoder, v reflect.Value) error { |
| 97 | mptr := v.Addr().Convert(mapStringStringPtrType).Interface().(*map[string]string) |
no test coverage detected