Canonical guidance

Use when

Avoid

Preferred pattern

g, ctx := errgroup.WithContext(ctx)
g.Go(func() error {
	return doWork(ctx)
})
return g.Wait()

Anti-pattern

Explanation: This is tempting because it removes immediate blocking, but it usually just moves the problem into lifecycle bugs.

Why

Related pages

Sources