Skip to content

errgroup implementation without ctx override quirk of original errgroup package

License

Notifications You must be signed in to change notification settings

sirkon/errgroup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 {
	
})

About

errgroup implementation without ctx override quirk of original errgroup package

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages