Comment by unsnap_biceps
Comment by unsnap_biceps 10 hours ago
buffered channels won't help here. That's just how many results can be buffered before the remaining results can be added to the channel. It doesn't wait until all of them are done before returning a result to the consumer.
> It doesn't wait until all of them are done before returning a result to the consumer.
Right, but it prevents goroutine leaks. In these situations I'm usually fine with bailing on the first error, but I grant that's not always desirable. If it's not, I would collect and join errors and return those along with partial results (if those are useful).