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

Method gPtr

gen/encode.go:318–331  ·  view source on GitHub ↗
(s *Ptr)

Source from the content-addressed store, hash-verified

316}
317
318func (e *encodeGen) gPtr(s *Ptr) {
319 if !e.p.ok() {
320 return
321 }
322 e.fuseHook()
323 e.p.printf("\nif %s == nil { err = en.WriteNil(); if err != nil { return; } } else {", s.Varname())
324 if s.typeParams.TypeParams != "" {
325 tp := s.typeParams
326 tp.isPtr = true
327 s.Value.SetTypeParams(tp)
328 }
329 next(e, s.Value)
330 e.p.closeblock()
331}
332
333func (e *encodeGen) gSlice(s *Slice) {
334 if !e.p.ok() {

Callers

nothing calls this directly

Calls 7

fuseHookMethod · 0.95
nextFunction · 0.85
okMethod · 0.80
printfMethod · 0.80
closeblockMethod · 0.80
VarnameMethod · 0.65
SetTypeParamsMethod · 0.65

Tested by

no test coverage detected