MCPcopy Create free account
hub / github.com/vmihailenco/msgpack / ptrValueDecoder

Function ptrValueDecoder

decode_value.go:126–140  ·  view source on GitHub ↗
(typ reflect.Type)

Source from the content-addressed store, hash-verified

124}
125
126func ptrValueDecoder(typ reflect.Type) decoderFunc {
127 decoder := getDecoder(typ.Elem())
128 return func(d *Decoder, v reflect.Value) error {
129 if d.hasNilCode() {
130 if !v.IsNil() {
131 v.Set(d.newValue(typ).Elem())
132 }
133 return d.DecodeNil()
134 }
135 if v.IsNil() {
136 v.Set(d.newValue(typ.Elem()))
137 }
138 return decoder(d, v.Elem())
139 }
140}
141
142func addrDecoder(fn decoderFunc) decoderFunc {
143 return func(d *Decoder, v reflect.Value) error {

Callers 1

_getDecoderFunction · 0.85

Calls 5

getDecoderFunction · 0.85
hasNilCodeMethod · 0.80
SetMethod · 0.80
newValueMethod · 0.80
DecodeNilMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…