MCPcopy
hub / github.com/redis/go-redis / BatchSlice

Method BatchSlice

internal/routing/aggregator.go:341–363  ·  view source on GitHub ↗
(results []AggregatorResErr)

Source from the content-addressed store, hash-verified

339}
340
341func (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
365func (a *AggMinAggregator) Result() (interface{}, error) {
366 err := a.err.Load()

Callers

nothing calls this directly

Calls 2

AddMethod · 0.95
toFloat64Function · 0.70

Tested by

no test coverage detected