解释上一次的谜团?
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")
}
```
本文标题:2019-04-26
本文链接:https://www.haomeiwen.com/subject/nmcxiqtx.html
网友评论