MCPcopy Create free account
hub / github.com/CovenantSQL/CovenantSQL / UnmarshalJSON

Method UnmarshalJSON

crypto/hash/hash.go:140–149  ·  view source on GitHub ↗

UnmarshalJSON implements the json.Unmarshaler interface.

(data []byte)

Source from the content-addressed store, hash-verified

138
139// UnmarshalJSON implements the json.Unmarshaler interface.
140func (h *Hash) UnmarshalJSON(data []byte) (err error) {
141 var s string
142 if err = json.Unmarshal(data, &s); err != nil {
143 return
144 }
145 if err = Decode(h, s); err != nil {
146 return
147 }
148 return nil
149}
150
151// MarshalYAML implements the yaml.Marshaler interface.
152func (h Hash) MarshalYAML() (interface{}, error) {

Callers

nothing calls this directly

Calls 2

DecodeFunction · 0.85
UnmarshalMethod · 0.80

Tested by

no test coverage detected