-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Go 1.20 errors.Join
instead of go.uber.org/multierr
#8210
Comments
@mx-psi kindly assign this one as well |
@mx-psi can you document why we stopped this effort until better understand the performance issue. |
I removed the The 'easy' way to change the code to use We can still use |
Note that I just proposed this additional patch to the Go team which will optimize the case where a single non-nil error is provided, and it can be returned as-is. |
@dmathieu The patch looks great, thanks for doing this :) I think the problem I was pointing at above is not addressed by existing code. The problem is the difference between these two: plainJoin := errors.Join(e1, e2, e3)
nestedJoin := errors.Join(errors.Join(e1, e2), e3)
plainAppend := multierr.Append(e1, e2, e3)
nestedAppend := multierr.Append(multierr.Append(e1, e2), e3) I believe opentelemetry-collector/service/service.go Lines 188 to 198 in 808fb7c
Only |
Yes, |
Go 1.20 includes new builtin error joining support that can replace the usage of
go.uber.org/multierr
. We should switch to using these and ban the usage ofgo.uber.org/multierr
viadepguard
(same as this).The text was updated successfully, but these errors were encountered: