godash
godash copied to clipboard
Add support for channels in godash.Reduce
API
input := make(chan int)
var output int
go func() {
for i := 0; i <= 5; i++ {
input <- i
}
close(input)
}()
godash.Reduce(input, &output, func(sum , element int) int {
return sum + element
})
fmt.Println(output)
// Output: 15
@dineshba I will work on this enhancement