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

Method Decode

docstore/gcpfirestore/native_codec_test.go:122–129  ·  view source on GitHub ↗

Decode value, which must be a *pb.Document, into dest.

(value *pb.Document, dest any)

Source from the content-addressed store, hash-verified

120
121// Decode value, which must be a *pb.Document, into dest.
122func (c *nativeCodec) Decode(value *pb.Document, dest any) error {
123 c.doc = value
124 docsnap, err := c.client.Collection("C").Doc("D").Get(context.Background())
125 if err != nil {
126 return err
127 }
128 return docsnap.DataTo(dest)
129}
130
131func TestNativeCodec(t *testing.T) {
132 nc, err := newNativeCodec()

Callers 4

NativeDecodeMethod · 0.45
DocstoreDecodeMethod · 0.45
decodeDocFunction · 0.45
TestNativeCodecFunction · 0.45

Calls 1

GetMethod · 0.45

Tested by

no test coverage detected