package mainimport "fmt"func main() {ca := createCounter(2)cb := createCounter(102)for i := 0; i < 5; i++ {a := <-cafmt.Printf("A %d \nB %d \n", a, <-cb)}}func createCounter(start int) chan int {next := make(chan int)go func(i int) {for {next <- ii++}}(start)return next}
-j
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.