MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / UnmarshalJSON

Method UnmarshalJSON

pkg/errors/json.go:49–56  ·  view source on GitHub ↗

UnmarshalJSON implements json.Unmarshaler. This func is purely implemented for consistency. In practice, you probably want to unmarshal into an *Error instead of a *Definition.

(data []byte)

Source from the content-addressed store, hash-verified

47// This func is purely implemented for consistency. In practice,
48// you probably want to unmarshal into an *Error instead of a *Definition.
49func (d *Definition) UnmarshalJSON(data []byte) error {
50 e := &Error{Definition: &Definition{}}
51 if err := e.UnmarshalJSON(data); err != nil {
52 return err
53 }
54 *d = *e.Definition
55 return nil
56}
57
58// UnmarshalJSON implements json.Unmarshaler.
59func (e *Error) UnmarshalJSON(data []byte) error {

Callers

nothing calls this directly

Calls 1

UnmarshalJSONMethod · 0.95

Tested by

no test coverage detected