Hacker News new | ask | show | jobs
by PurelyApplied 1083 days ago
Do you typically need to check both `Done` and `ok`? The latter is only false when the channel is empty and closed, so unless multiple routines are pulling from that channel, you should only need one, should you not?
1 comments

You absolutely should, because context cancellation does not imply a closed channel and vice versa.
Oh, duh. I shouldn't try to read code past midnight...

Thank you!