Last active
April 1, 2024 11:27
-
-
Save tmvrus/c65d8d98a92da73a7b6c48aa8370c16d 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
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