Skip to content

Instantly share code, notes, and snippets.

@AntiKnot
Last active January 20, 2022 08:59
Show Gist options
  • Select an option

  • Save AntiKnot/3d00b6da0c6b1f4539f7addb3ebf91e7 to your computer and use it in GitHub Desktop.

Select an option

Save AntiKnot/3d00b6da0c6b1f4539f7addb3ebf91e7 to your computer and use it in GitHub Desktop.
go channel is sync
package main
func main() {
ch := make(chan bool)
ch <- true
<-ch
}
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