DEV Community

Discussion on: Go, I love you, but you're bringing me down.

mdrollette profile image
Matt Drollette

On the closed channels point - reading from a channel returns a second boolean argument that indicates if the channel is closed or not. So, for your example you could do n, ok := <-ca and if ca had been closed the value of ok would be false

loderunner profile image
Charles Francoise Author


Sameer Ajmani pointed it out on Twitter. I updated the post.

That's one problem down!