MCPcopy Create free account
hub / github.com/prometheus/common / MarshalJSON

Method MarshalJSON

model/time.go:334–336  ·  view source on GitHub ↗

MarshalJSON implements the json.Marshaler interface.

()

Source from the content-addressed store, hash-verified

332
333// MarshalJSON implements the json.Marshaler interface.
334func (d Duration) MarshalJSON() ([]byte, error) {
335 return json.Marshal(d.String())
336}
337
338// UnmarshalJSON implements the json.Unmarshaler interface.
339func (d *Duration) UnmarshalJSON(bytes []byte) error {

Callers

nothing calls this directly

Calls 1

StringMethod · 0.95

Tested by

no test coverage detected