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