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

Method MarshalJSON

model/value.go:271–273  ·  view source on GitHub ↗

MarshalJSON implements json.Marshaler.

()

Source from the content-addressed store, hash-verified

269
270// MarshalJSON implements json.Marshaler.
271func (s String) MarshalJSON() ([]byte, error) {
272 return json.Marshal([]any{s.Timestamp, s.Value})
273}
274
275// UnmarshalJSON implements json.Unmarshaler.
276func (s *String) UnmarshalJSON(b []byte) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected