(collections []Map, resultVal Map, cb Reducer)
| 21 | } |
| 22 | |
| 23 | func Reduce(collections []Map, resultVal Map, cb Reducer) Map { |
| 24 | for _, collection := range collections { |
| 25 | for _, key := range collection.Keys() { |
| 26 | resultVal = cb(key, collection.Get(key), resultVal) |
| 27 | } |
| 28 | } |
| 29 | return resultVal |
| 30 | } |
| 31 | |
| 32 | func mergeReducer(key, val interface{}, reduced Map) Map { |
| 33 | switch { |
no test coverage detected