Last active
January 20, 2022 08:59
-
-
Save AntiKnot/3d00b6da0c6b1f4539f7addb3ebf91e7 to your computer and use it in GitHub Desktop.
go channel is sync
This file contains hidden or 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 main | |
| func main() { | |
| ch := make(chan bool) | |
| ch <- true | |
| <-ch | |
| } |
This file contains hidden or 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 main | |
| func main() { | |
| go func() { | |
| for {} | |
| } | |
| ch := make(chan bool) | |
| ch <- true | |
| <-ch | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment