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