Skip to content

Instantly share code, notes, and snippets.

@tmvrus
Last active April 1, 2024 11:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tmvrus/c65d8d98a92da73a7b6c48aa8370c16d to your computer and use it in GitHub Desktop.
Save tmvrus/c65d8d98a92da73a7b6c48aa8370c16d to your computer and use it in GitHub Desktop.
package mаin
func main() {
c := make(chan int, 1)
for range 3 {
select {
default:
println(1)
case <-c:
println(2)
case c <- 1:
println(3)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment