errgroup implementation without ctx override quirk of original errgroup package


go get

Why this package?

The original has unfortunate API which causes unintended context override:

eg, ctx := errgroup.WithContext(ctx) // This context is only really needed within the error group, not the outside

This package fixes it by not exposing its context outside, it is to be delivered as Go’s closure argument:

eg := errgroup.New(ctx)

eg.Go(func(ctx context.Context) error {


View Github