(buf []byte)
| 156 | } |
| 157 | |
| 158 | func (s *SampleHistogramPair) UnmarshalJSON(buf []byte) error { |
| 159 | tmp := []any{&s.Timestamp, &s.Histogram} |
| 160 | wantLen := len(tmp) |
| 161 | if err := json.Unmarshal(buf, &tmp); err != nil { |
| 162 | return err |
| 163 | } |
| 164 | if gotLen := len(tmp); gotLen != wantLen { |
| 165 | return fmt.Errorf("wrong number of fields: %d != %d", gotLen, wantLen) |
| 166 | } |
| 167 | if s.Histogram == nil { |
| 168 | return errors.New("histogram is null") |
| 169 | } |
| 170 | return nil |
| 171 | } |
| 172 | |
| 173 | func (s SampleHistogramPair) String() string { |
| 174 | return fmt.Sprintf("%s @[%s]", s.Histogram, s.Timestamp) |
nothing calls this directly
no outgoing calls
no test coverage detected