Method
BatchSlice
(results []AggregatorResErr)
Source from the content-addressed store, hash-verified
| 339 | } |
| 340 | |
| 341 | func (a *AggMinAggregator) BatchSlice(results []AggregatorResErr) error { |
| 342 | min := float64(math.MaxFloat64) |
| 343 | |
| 344 | for _, res := range results { |
| 345 | if res.Err != nil { |
| 346 | _ = a.Add(nil, res.Err) |
| 347 | return nil |
| 348 | } |
| 349 | |
| 350 | floatVal, err := toFloat64(res.Result) |
| 351 | if err != nil { |
| 352 | _ = a.Add(nil, res.Err) |
| 353 | return nil |
| 354 | } |
| 355 | |
| 356 | if floatVal < min { |
| 357 | min = floatVal |
| 358 | } |
| 359 | |
| 360 | } |
| 361 | |
| 362 | return a.Add(min, nil) |
| 363 | } |
| 364 | |
| 365 | func (a *AggMinAggregator) Result() (interface{}, error) { |
| 366 | err := a.err.Load() |
Callers
nothing calls this directly
Tested by
no test coverage detected