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

Method MarshalJSON

model/value_float.go:73–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71}
72
73func (s SamplePair) MarshalJSON() ([]byte, error) {
74 t, err := json.Marshal(s.Timestamp)
75 if err != nil {
76 return nil, err
77 }
78 v, err := json.Marshal(s.Value)
79 if err != nil {
80 return nil, err
81 }
82 return fmt.Appendf(nil, "[%s,%s]", t, v), nil
83}
84
85// UnmarshalJSON implements json.Unmarshaler.
86func (s *SamplePair) UnmarshalJSON(b []byte) error {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected