MCPcopy Create free account
hub / github.com/segmentio/encoding / customDecodeFuncOf

Function customDecodeFuncOf

proto/custom.go:64–79  ·  view source on GitHub ↗
(t reflect.Type)

Source from the content-addressed store, hash-verified

62}
63
64func customDecodeFuncOf(t reflect.Type) decodeFunc {
65 return func(b []byte, p unsafe.Pointer, flags flags) (int, error) {
66 m := reflect.NewAt(t, p).Interface().(customMessage)
67
68 if flags.has(toplevel) {
69 return len(b), m.Unmarshal(b)
70 }
71
72 v, n, err := decodeVarlen(b)
73 if err != nil {
74 return n, err
75 }
76
77 return n + len(v), m.Unmarshal(v)
78 }
79}

Callers 1

customCodecOfFunction · 0.85

Calls 3

decodeVarlenFunction · 0.85
UnmarshalMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…