mirror of
https://github.com/tmrts/go-patterns.git
synced 2025-04-02 20:56:12 +03:00
Merge f9557e066b
into f978e42036
This commit is contained in:
commit
7c9ec67548
1 changed files with 6 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue