liveBook · Manning

Errgroup

errgroup is a Go package that coordinates concurrent functions or goroutines, propagates their errors, and can integrate cancellation through a context.

How 2 Manning books explain it

Learn Go with Pocket-Sized Projects

errgroup is a Go package for synchronizing goroutines while collecting errors from their functions.

How it is used
Coordinates concurrent goroutines while replacing explicit error-channel handling with Group methods.
How deep it goes
Explains Group creation, Go, SetLimit, and Wait, but defers detailed context treatment.
Examples
Demonstrates concurrent cooking of rice and curry with a two-goroutine limit.
What you can do after
Operate golang.org/x/sync/errgroup to launch limited concurrent work and handle errors returned by Wait.

Read how Learn Go with Pocket-Sized Projects explains errgroup →

100 Go Mistakes and How to Avoid Them

errgroup is a Go package for coordinating groups of goroutines with synchronization, error propagation, and context cancellation.

How it is used
Coordinates parallel calls while propagating errors and handling cancellation through a context.
How deep it goes
Demonstrates installation, group creation, worker functions, indexed results, and g.Wait, without explaining package internals.
Examples
Uses a handler that splits input circles into parallel external calls and stores results in input order.
What you can do after
Apply it via golang.org/x/sync/errgroup to coordinate parallel Go work and return one encountered error.

Read how 100 Go Mistakes and How to Avoid Them explains errgroup →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.