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

Method MarshalJSON

model/time.go:120–122  ·  view source on GitHub ↗

MarshalJSON implements the json.Marshaler interface.

()

Source from the content-addressed store, hash-verified

118
119// MarshalJSON implements the json.Marshaler interface.
120func (t Time) MarshalJSON() ([]byte, error) {
121 return []byte(t.String()), nil
122}
123
124// UnmarshalJSON implements the json.Unmarshaler interface.
125func (t *Time) UnmarshalJSON(b []byte) error {

Callers 1

TestTimeJSONFunction · 0.45

Calls 1

StringMethod · 0.95

Tested by 1

TestTimeJSONFunction · 0.36