have following doubt

How can function sq in line 6 read again from the channel "in" ? I thought

its already read a line before. If yes how can we say the sq work is

distributed across 2 go routines ? I think I am missing some core concept

here. Please help me to understand the code below

1 func main() {2 in := gen(2, 3)34 // Distribute the sq work across two goroutines that both read from in.5 c1 := sq(in)6 c2 := sq(in)78 // Consume the merged output from c1 and c2.9 for n := range merge(c1, c2) {10 fmt.Println(n) // 4 then 9, or 9 then 411 }

12 }

Thanks,

Anumodh

--

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+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.