()
| 141 | } |
| 142 | |
| 143 | func (s SampleHistogramPair) MarshalJSON() ([]byte, error) { |
| 144 | if s.Histogram == nil { |
| 145 | return nil, errors.New("histogram is nil") |
| 146 | } |
| 147 | t, err := json.Marshal(s.Timestamp) |
| 148 | if err != nil { |
| 149 | return nil, err |
| 150 | } |
| 151 | v, err := json.Marshal(s.Histogram) |
| 152 | if err != nil { |
| 153 | return nil, err |
| 154 | } |
| 155 | return fmt.Appendf(nil, "[%s,%s]", t, v), nil |
| 156 | } |
| 157 | |
| 158 | func (s *SampleHistogramPair) UnmarshalJSON(buf []byte) error { |
| 159 | tmp := []any{&s.Timestamp, &s.Histogram} |
nothing calls this directly
no outgoing calls
no test coverage detected