1
0
mirror of https://github.com/tmrts/go-patterns.git synced 2024-11-24 05:56:08 +03:00

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)
go func(ch chan int) {
for i := start; i < end ; i++ {
for i := start; i <= end ; i++ {
// Blocks on the operation
ch <- i
}