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

Method Execute

gen/unmarshal.go:34–56  ·  view source on GitHub ↗
(p Elem, ctx Context)

Source from the content-addressed store, hash-verified

32}
33
34func (u *unmarshalGen) Execute(p Elem, ctx Context) error {
35 u.hasfield = false
36 u.ctx = &ctx
37 if !u.p.ok() {
38 return u.p.err
39 }
40 p = u.applyall(p)
41 if p == nil {
42 return nil
43 }
44 if !IsPrintable(p) {
45 return nil
46 }
47
48 u.p.comment("UnmarshalMsg implements msgp.Unmarshaler")
49
50 u.p.printf("\nfunc (%s %s) UnmarshalMsg(bts []byte) (o []byte, err error) {", p.Varname(), methodReceiver(p))
51 next(u, p)
52 u.p.print("\no = bts")
53 u.p.nakedReturn()
54 unsetReceiver(p)
55 return u.p.err
56}
57
58// does assignment to the variable "name" with the type "base"
59func (u *unmarshalGen) assignAndCheck(name string, base string) {

Callers

nothing calls this directly

Calls 11

IsPrintableFunction · 0.85
methodReceiverFunction · 0.85
nextFunction · 0.85
unsetReceiverFunction · 0.85
okMethod · 0.80
applyallMethod · 0.80
commentMethod · 0.80
printfMethod · 0.80
printMethod · 0.80
nakedReturnMethod · 0.80
VarnameMethod · 0.65

Tested by

no test coverage detected