concurrency/generator: use inclusive range in iteration

Fixes #23
This commit is contained in:
Niranjan Godbole 2017-03-08 20:13:35 +05:30 committed by Tamer Tas
parent 0ca6f6652d
commit 399a51c7fe

View File

@ -9,7 +9,7 @@ func Count(start int, end int) chan int {
ch := make(chan int) ch := make(chan int)
go func(ch chan int) { go func(ch chan int) {
for i := start; i < end ; i++ { for i := start; i <= end ; i++ {
// Blocks on the operation // Blocks on the operation
ch <- i ch <- i
} }