When using errgroup.WithContext, the first non-nil error encountered will cancel the context and then be returned by the next call to Wait. This works well when you actually call Wait, but if that canceled context prevents you from calling Wait, you just get an unhelpful context canceled error.
I believe the new context.WithCancelCause added in 1.20 would fix this, so I propose we use that instead of this context.WithCancel so we can propagate the error here, here, and here.
When using
errgroup.WithContext, the first non-nil error encountered will cancel the context and then be returned by the next call toWait. This works well when you actually callWait, but if that canceled context prevents you from callingWait, you just get an unhelpfulcontext cancelederror.I believe the new
context.WithCancelCauseadded in 1.20 would fix this, so I propose we use that instead of thiscontext.WithCancelso we can propagate the error here, here, and here.