-
-
Save leonardo5621/bb9ae69fa62c7d8c8f66a52e0c9006e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func printIntegers(done <-chan struct{}, intStream <-chan int) { | |
for{ | |
select { | |
case i := <-intStream: | |
fmt.Println(i) | |
case <-done: | |
return | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment