MCPcopy Create free account
hub / github.com/google/go-cloud / Decode

Function Decode

docstore/driver/codec.go:375–377  ·  view source on GitHub ↗

Decode decodes the value held in the Decoder d into v. Decode creates slices, maps and pointer elements as needed. It treats values that implement encoding.BinaryUnmarshaler, encoding.TextUnmarshaler and proto.Message specially; see Encode.

(v reflect.Value, d Decoder)

Source from the content-addressed store, hash-verified

373// It treats values that implement encoding.BinaryUnmarshaler,
374// encoding.TextUnmarshaler and proto.Message specially; see Encode.
375func Decode(v reflect.Value, d Decoder) error {
376 return wrap(decode(v, d), gcerr.InvalidArgument)
377}
378
379func decode(v reflect.Value, d Decoder) error {
380 if !v.CanSet() {

Callers 5

TestDecodeValueFunction · 0.92
TestDecodeFunction · 0.70
TestDecodeErrorsFunction · 0.70
TestDecodeFailFunction · 0.70

Calls 2

wrapFunction · 0.85
decodeFunction · 0.70

Tested by 5

TestDecodeValueFunction · 0.74
TestDecodeFunction · 0.56
TestDecodeErrorsFunction · 0.56
TestDecodeFailFunction · 0.56