errgroup

errgroup implementation without ctx override quirk of original errgroup package

Installation

go get github.com/sirkon/errgroup

Why this package?

The original golan.org/x/sync/errgroup 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 {
	
})

GitHub

View Github