On Sun, Jun 5, 2022 at 4:06 PM Manjeet S <manjeetsar...@gmail.com> wrote:

> Can someone help me to understand why this code is not working. I'm expecting 
> that <-ch wait until we receive from channel ch

The range statement at line 18 does not complete unless the channel is
closed. Adding `close(ch2)` at line 14 fixes the problem:
https://go.dev/play/p/OnmJD04VYDA

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-W0-aWsu%2BMtukruWyT7f1H9r4zfnfE6%3D%2BCsAXShE%3DGCUg%40mail.gmail.com.

Reply via email to