add more tests

This commit is contained in:
kevin
2020-09-16 20:03:30 +08:00
parent b5dcadda78
commit f994e1df1a
3 changed files with 98 additions and 9 deletions

View File

@@ -127,8 +127,8 @@ func MapReduceWithSource(source <-chan interface{}, mapper MapperFunc, reducer R
drain(collector)
}()
go executeMappers(func(item interface{}, writer Writer) {
mapper(item, writer, cancel)
go executeMappers(func(item interface{}, w Writer) {
mapper(item, w, cancel)
}, source, collector, done.Done(), options.workers)
value, ok := <-output