MCPcopy
hub / github.com/tinylib/msgp / gPtr

Method gPtr

gen/decode.go:501–521  ·  view source on GitHub ↗
(p *Ptr)

Source from the content-addressed store, hash-verified

499}
500
501func (d *decodeGen) gPtr(p *Ptr) {
502 if !d.p.ok() {
503 return
504 }
505 d.p.print("\nif dc.IsNil() {")
506 d.p.print("\nerr = dc.ReadNil()")
507 d.p.wrapErrCheck(d.ctx.ArgsStr())
508 d.p.printf("\n%s = nil\n} else {", p.Varname())
509 d.p.initPtr(p)
510 if p.typeParams.TypeParams != "" {
511 tp := p.typeParams
512 tp.isPtr = true
513 p.Value.SetTypeParams(tp)
514 }
515 if be, ok := p.Value.(*BaseElem); ok {
516 be.parentIsPtr = true
517 defer func() { be.parentIsPtr = false }()
518 }
519 next(d, p.Value)
520 d.p.closeblock()
521}

Callers

nothing calls this directly

Calls 10

nextFunction · 0.85
okMethod · 0.80
printMethod · 0.80
wrapErrCheckMethod · 0.80
ArgsStrMethod · 0.80
printfMethod · 0.80
initPtrMethod · 0.80
closeblockMethod · 0.80
VarnameMethod · 0.65
SetTypeParamsMethod · 0.65

Tested by

no test coverage detected