package errgroup
Import Path
golang.org/x/sync/errgroup (on go.dev)
Dependency Relation
imports 2 packages, and imported by 2 packages
Involved Source Files
Package errgroup provides synchronization, error propagation, and Context
cancelation for groups of goroutines working on subtasks of a common task.
Package-Level Type Names (only one, which is exported)
A Group is a collection of goroutines working on subtasks that are part of
the same overall task.
A zero Group is valid and does not cancel on error.
cancel func()
err error
errOnce sync.Once
wg sync.WaitGroup
Go calls the given function in a new goroutine.
The first call to return a non-nil error cancels the group; its error will be
returned by Wait.
Wait blocks until all function calls from the Go method have returned, then
returns the first non-nil error (if any) from them.
func WithContext(ctx context.Context) (*Group, context.Context)
Package-Level Functions (only one, which is exported)
WithContext returns a new Group and an associated Context derived from ctx.
The derived Context is canceled the first time a function passed to Go
returns a non-nil error or the first time Wait returns, whichever occurs
first.
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |