-
-
Save leonardo5621/90ff98dc96ff69c62cb9f81eb881509f 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(ctx context.Context, intStream <-chan int) { | |
for{ | |
select { | |
case i := <-intStream: | |
fmt.Println(i) | |
case <-ctx.Done(): | |
return | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment