(m *Map)
| 514 | } |
| 515 | |
| 516 | func (u *unmarshalGen) gMap(m *Map) { |
| 517 | if !u.p.ok() { |
| 518 | return |
| 519 | } |
| 520 | sz := randIdent() |
| 521 | u.p.declare(sz, u32) |
| 522 | u.assignMap(sz, mapHeader, 0) |
| 523 | |
| 524 | // allocate or clear map |
| 525 | u.p.resizeMap(sz, m) |
| 526 | |
| 527 | // We likely need a field. |
| 528 | // Add now to not be inside for scope. |
| 529 | u.needsField() |
| 530 | |
| 531 | // loop and get key,value |
| 532 | u.p.printf("\nfor %s > 0 {", sz) |
| 533 | u.p.printf("\nvar %s %s; %s--", m.Validx, m.Value.TypeName(), sz) |
| 534 | m.readKey(u.ctx, u.p, u, u.assignAndCheck) |
| 535 | u.ctx.PushVar(m.Keyidx) |
| 536 | m.Value.SetIsAllowNil(false) |
| 537 | setTypeParams(m.Value, m.typeParams) |
| 538 | next(u, m.Value) |
| 539 | u.ctx.Pop() |
| 540 | u.p.mapAssign(m) |
| 541 | u.p.closeblock() |
| 542 | } |
| 543 | |
| 544 | func (u *unmarshalGen) gPtr(p *Ptr) { |
| 545 | u.p.printf("\nif msgp.IsNil(bts) { bts, err = msgp.ReadNilBytes(bts); if err != nil { return }; %s = nil; } else { ", p.Varname()) |
nothing calls this directly
no test coverage detected