Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

Why Your Team Should Stop Reaching for errgroup by Default

DEV Community·Gabriel Anhaia·about 1 month ago
#QKRGkHOa
Reading 0:00
15s threshold

Book: The Complete Guide to Go Programming Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub You have seen the pattern. A handler needs to enrich a response from four backends. Someone reaches for golang.org/x/sync/errgroup , writes four g.Go(func() error { ... }) blocks, and ships. Code review nods. Tests pass. Everyone moves on. A team I worked with did exactly this for two years. Then a partial outage downstream caused one of the four enrichments to error early. The other three were halfway through expensive work nobody wanted to throw away. errgroup cancelled them anyway, the user got a 502 on data that was already 75% computed, and the on-call got paged. The tool was wrong for the job, and nobody had read the godoc carefully enough to notice. errgroup is a fine tool for the case it was built for.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More