1
0
Fork 0
mirror of https://github.com/tmrts/go-patterns.git synced 2025-04-02 20:56:12 +03:00
This commit is contained in:
Gregory Ganley 2021-02-20 21:13:50 +00:00 committed by GitHub
commit 7c9ec67548
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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