(m *Map)
| 438 | } |
| 439 | |
| 440 | func (d *decodeGen) gMap(m *Map) { |
| 441 | if !d.p.ok() { |
| 442 | return |
| 443 | } |
| 444 | sz := randIdent() |
| 445 | |
| 446 | // resize or allocate map |
| 447 | d.p.declare(sz, u32) |
| 448 | d.assignMap(sz, mapHeader, 0) |
| 449 | d.p.resizeMap(sz, m) |
| 450 | |
| 451 | // for element in map, read string/value |
| 452 | // pair and assign |
| 453 | d.needsField() |
| 454 | d.p.printf("\nfor %s > 0 {\n%s--", sz, sz) |
| 455 | m.readKey(d.ctx, d.p, d, d.assignAndCheck) |
| 456 | d.p.declare(m.Validx, m.Value.TypeName()) |
| 457 | d.ctx.PushVar(m.Keyidx) |
| 458 | m.Value.SetIsAllowNil(false) |
| 459 | setTypeParams(m.Value, m.typeParams) |
| 460 | next(d, m.Value) |
| 461 | d.p.mapAssign(m) |
| 462 | d.ctx.Pop() |
| 463 | d.p.closeblock() |
| 464 | } |
| 465 | |
| 466 | func (d *decodeGen) gSlice(s *Slice) { |
| 467 | if !d.p.ok() { |
nothing calls this directly
no test coverage detected