Skip to content

Instantly share code, notes, and snippets.

@Mitmischer
Last active December 18, 2015 22:09
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 Mitmischer/5852217 to your computer and use it in GitHub Desktop.
Save Mitmischer/5852217 to your computer and use it in GitHub Desktop.
Go zersetzt mein Gehirn!
package main
import "fmt"
// works
func main(){
c := make(chan int)
go func(c chan int){
fmt.Println(<-c)
}(c)
go func(){
c <- 2
}()
}
// deadlock!
//func main(){
// c := make(chan int)
// go fmt.Println(<-c)
// go func(){
// c <- 2
// }()
//}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment