package main
import "fmt"
func main(){
var i chan int = make(chan int)
fmt.Println("i:",i)
go func(){
fmt.Println("goroutine back")
j := <-i
fmt.Println("j:",j)
}()
fmt.Println("main first")
i <-1
fmt.Println("2")
}
为什么为channel加了缓冲区以后goroutine里的code就不执行了?
婷婷同学_
隔江千里