解释上一次的谜团?
1 为什么会死锁?
```
package main
import (
"fmt"
)
func f1(in chan int) {
number := <- in
fmt.Println(number)
}
func main() {
out := make(chan int)
out <- 2
go f1(out)
fmt.Println("end")
}
```
解释上一次的谜团?
1 为什么会死锁?
```
package main
import (
"fmt"
)
func f1(in chan int) {
number := <- in
fmt.Println(number)
}
func main() {
out := make(chan int)
out <- 2
go f1(out)
fmt.Println("end")
}
```