Groxx 12 hours ago

It does not, which is easy to verify from the source. Every func passed in is always run (with the exception of TryGo which is explicitly "maybe").

At best, using the optional, higher-effort errgroup.WithContext will cancel the context but still run all of your funcs. If you don't want that for one of the funcs, or some component of them, just don't use the context.

evanelias 11 hours ago

If the context cancellation is undesirable, you just choose not to use WithContext, as the sibling comment mentions.

You could also just make your subtask function return nil always, if you just want to get the automatic bookkeeping call pattern (like WaitGroup.Go from Golang 1.25), plus optional concurrency limiting.

Also note, even if a subtask function returns an error, the errgroup Wait blocking semantics are identical to those of a WaitGroup. Wait will return the first error when it returns, but it doesn't unblock early on first error.