2 ms·
(with "you" being the author or anyone): Would you be able to explain why you iterate over the range of providers instead of iterating over the channel in you
by kbar13 12y ago
(with "you" being the author or anyone):
Would you be able to explain why you iterate over the range of providers instead of iterating over the channel in your concurrency example?
- sagichmal 12y agoRange over a channel only terminates when the channel is closed, which that example doesn't do. Since the channel is created as buffered, you could do a normal for-loop over cap(chan), which would be the same as len(providers).