MCPcopy Index your code
hub / github.com/vmihailenco/msgpack / decodeArrayValue

Function decodeArrayValue

decode_slice.go:133–154  ·  view source on GitHub ↗
(d *Decoder, v reflect.Value)

Source from the content-addressed store, hash-verified

131}
132
133func decodeArrayValue(d *Decoder, v reflect.Value) error {
134 n, err := d.DecodeArrayLen()
135 if err != nil {
136 return err
137 }
138
139 if n == -1 {
140 return nil
141 }
142 if n > v.Len() {
143 return fmt.Errorf("%s len is %d, but msgpack has %d elements", v.Type(), v.Len(), n)
144 }
145
146 for i := 0; i < n; i++ {
147 sv := v.Index(i)
148 if err := d.DecodeValue(sv); err != nil {
149 return err
150 }
151 }
152
153 return nil
154}
155
156func (d *Decoder) DecodeSlice() ([]interface{}, error) {
157 c, err := d.readCode()

Callers

nothing calls this directly

Calls 2

DecodeArrayLenMethod · 0.80
DecodeValueMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…