4 ms·
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 fro
by PurelyApplied 3y 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?
- rollulus 3y agoYou absolutely should, because context cancellation does not imply a closed channel and vice versa.
- PurelyApplied 3y agoOh, duh. I shouldn't try to read code past midnight... Thank you!