当一组 goroutine 互相等待并且没有一个 goroutine 能够继续执行时,就会发生死锁。
例如:
func main() { ch := make(chan int) ch <- 1 fmt.Println(<-ch) }
但如果我们不使用通道,是否有可能发生死锁呢?
go
go ×1