Skip to content

Instantly share code, notes, and snippets.

@buth
Created September 23, 2014 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buth/12a06bd02616b9671b69 to your computer and use it in GitHub Desktop.
Save buth/12a06bd02616b9671b69 to your computer and use it in GitHub Desktop.
go-routine / channel puzzle
package main
func send(c chan int, i int){
c <- i
}
func main() {
c := make(chan int)
go send(c, 1)
go send(c, 2)
<-c // Always 1?
<-c // Always 2?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment