Comment by stefanos82
Comment by stefanos82 14 hours ago
Personally I wished they had it backported to previous versions too, because it's rather convenient!
What is quite sad is that we cannot add it ourselves as it's so simple of what they have done:
func (wg *WaitGroup) Go(f func()) {
wg.Add(1)
go func() {
defer wg.Done()
f()
}()
}
You can just use golang.org/x/sync/errgroup instead, which has always provided this style of use.
errgroup also has other niceties like error propagation, context cancellation, and concurrency limiting.