Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
PurelyApplied
· 3y ago · 0 comments
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?
Comments
[–]
rollulus
3y ago
You absolutely should, because context cancellation does not imply a closed channel and vice versa.
[–]
PurelyApplied
OP
3y ago
Oh, duh. I shouldn't try to read code past midnight...
Thank you!