decodeArray decodes an array value.
(ods *objectDecodeState, obj reflect.Value, encoded *wire.Array)
| 434 | |
| 435 | // decodeArray decodes an array value. |
| 436 | func (ds *decodeState) decodeArray(ods *objectDecodeState, obj reflect.Value, encoded *wire.Array) { |
| 437 | if len(encoded.Contents) != obj.Len() { |
| 438 | Failf("mismatching array length expect=%d, actual=%d", obj.Len(), len(encoded.Contents)) |
| 439 | } |
| 440 | // Decode the contents into the array. |
| 441 | for i := 0; i < len(encoded.Contents); i++ { |
| 442 | ds.decodeObject(ods, obj.Index(i), encoded.Contents[i]) |
| 443 | ds.waitObject(ods, encoded.Contents[i], nil) |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | // findType finds the type for the given wire.TypeSpecs. |
| 448 | func (ds *decodeState) findType(t wire.TypeSpec) reflect.Type { |
no test coverage detected