MCPcopy Create free account
hub / github.com/segmentio/encoding / UnmarshalJSON

Method UnmarshalJSON

json/json_test.go:724–732  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

722}
723
724func (d *duration) UnmarshalJSON(b []byte) error {
725 var s string
726 if err := json.Unmarshal(b, &s); err != nil {
727 return err
728 }
729 x, err := time.ParseDuration(s)
730 *d = duration(x)
731 return err
732}
733
734var (
735 _ Marshaler = jsonValue{}

Callers 1

decodeJSONUnmarshalerMethod · 0.45

Calls 2

durationTypeAlias · 0.85
UnmarshalMethod · 0.65

Tested by

no test coverage detected