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

Method Add

internal/routing/aggregator.go:222–237  ·  view source on GitHub ↗
(result interface{}, err error)

Source from the content-addressed store, hash-verified

220}
221
222func (a *AggSumAggregator) Add(result interface{}, err error) error {
223 if err != nil {
224 a.err.CompareAndSwap(nil, err)
225 }
226
227 if result != nil {
228 val, err := toFloat64(result)
229 if err != nil {
230 a.err.CompareAndSwap(nil, err)
231 return err
232 }
233 a.res.Add(val)
234 }
235
236 return nil
237}
238
239func (a *AggSumAggregator) BatchAdd(results map[string]AggregatorResErr) error {
240 var sum int64

Callers 3

BatchAddMethod · 0.95
AddWithKeyMethod · 0.95
BatchSliceMethod · 0.95

Calls 2

toFloat64Function · 0.70
AddMethod · 0.65

Tested by

no test coverage detected