<iframe style="border:1px solid" src="https://wide.b3log.org/playground/d4cc5ad44d62ec939d9769e6dbfadc7b.go" width="99%" height="600"></iframe>
为什么会出现死锁的问题?
fatal error: all goroutines are asleep - deadlock!
for i := 0; i < 10; i++ {
chs[i] = make(chan int)
go test(chs[i])
}
加上一句代码
#1