```go
func sum(a []int, c chan int) {
total := 0
for _, v := range a {
total += v
}
c <- total
}
func main() {
a := []int{7, 2, 8, -9, 4, 0}
c := make(chan int)
go sum(a[:len(a)/2], c) // 17
go sum(a[len(a)/2:], c) // -5
x, y := <-c, <-c
fmt.Println(x, y, x+y)
```
为什么这段代码,***变量x***输出的值是***-5***,***而不是17?***
楼主,你这问题不是必现,我跑了1000次,能出现一两次 17 -5 12
for i in {1..1000}; do GOMAXPROCS=6 go run main.go; done
#4