Y
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
rollulus
1083 days ago
You absolutely should, because context cancellation does not imply a closed channel and vice versa.
link
PurelyApplied
1083 days ago
Oh, duh. I shouldn't try to read code past midnight...
Thank you!
link