What will be the output of this code?
ch := make(chan int) ch <- 7 val := <-ch fmt.Println(val)
It will not compile
2.718 Go Playground share, output:
fatal error: all goroutines are asleep - deadlock! goroutine 1 [chan send]: main.main() /tmp/sandbox2282523250/prog.go:7 +0x37 Program exited.
It will deadlock
0