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

Method MarshalJSON

json/json_test.go:720–722  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

718type duration time.Duration
719
720func (d duration) MarshalJSON() ([]byte, error) {
721 return []byte(`"` + time.Duration(d).String() + `"`), nil
722}
723
724func (d *duration) UnmarshalJSON(b []byte) error {
725 var s string

Callers

nothing calls this directly

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected