MCPcopy Create free account
hub / github.com/go-dev-frame/sponge / Unmarshal

Method Unmarshal

pkg/encoding/json_encoding.go:48–59  ·  view source on GitHub ↗

Unmarshal json encode and gzip

(data []byte, value interface{})

Source from the content-addressed store, hash-verified

46
47// Unmarshal json encode and gzip
48func (jz JSONGzipEncoding) Unmarshal(data []byte, value interface{}) error {
49 jsonData, err := GzipDecode(data)
50 if err != nil {
51 return err
52 }
53
54 err = json.Unmarshal(jsonData, value)
55 if err != nil {
56 return err
57 }
58 return nil
59}
60
61// GzipEncode encoding
62func GzipEncode(in []byte) ([]byte, error) {

Callers 1

TestEncodingErrorFunction · 0.95

Calls 2

GzipDecodeFunction · 0.85
UnmarshalMethod · 0.65

Tested by 1

TestEncodingErrorFunction · 0.76