Skip to content

Instantly share code, notes, and snippets.

@leonardo5621
Last active July 25, 2022 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leonardo5621/bb9ae69fa62c7d8c8f66a52e0c9006e0 to your computer and use it in GitHub Desktop.
Save leonardo5621/bb9ae69fa62c7d8c8f66a52e0c9006e0 to your computer and use it in GitHub Desktop.
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