blob: 0f3981273bb623ac81dba7432aebb9440e29e717 [file] [log] [blame]
// +build ignore,OMIT
package main
import "fmt"
func f(left, right chan int) {
left <- 1 + <-right
}
func main() {
const n = 10000
leftmost := make(chan int)
right := leftmost
left := leftmost
for i := 0; i < n; i++ {
right = make(chan int)
go f(left, right)
left = right
}
go func(c chan int) { c <- 1 }(right)
fmt.Println(<-leftmost)
}