-
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
[all] Replace multierr by errors.Join #8630
Conversation
6ac024b
to
61ab3d0
Compare
61ab3d0
to
baaee82
Compare
Codecov ReportAttention:
... and 2 files with indirect coverage changes 📢 Thoughts on this report? Let us know!. |
@dmitryax I had to re-run the tests on this PR a few times because of a data race in Data race in tests
Could you take a look and confirm that this PR is unrelated to this flaky test? |
var errs []error | ||
|
||
switch t.Kind() { | ||
case reflect.Ptr: | ||
errs = multierr.Append(errs, validateConfigDataType(t.Elem())) | ||
errs = append(errs, validateConfigDataType(t.Elem())) | ||
case reflect.Struct: | ||
// Reflect on the pointed data and check each of its fields. | ||
nf := t.NumField() | ||
for i := 0; i < nf; i++ { | ||
f := t.Field(i) | ||
errs = multierr.Append(errs, checkStructFieldTags(f)) | ||
errs = append(errs, checkStructFieldTags(f)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't matter that much here, but this adds lots of allocations. Do we care? Do we want to have a helper type (internal) "MultiError" with an append that does not append to the array if nil
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point. I don't think we care in most places but there are some where we definitely do care; e.g. the fanoutconsumer Consume*
calls seems like a place where we should avoid this.
Should we use the helper just for those places? We could also just continue using multierr
on those for now and report this on golang/go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
report this on golang/go
I think we should definitely do that.
Should we use the helper just for those places? We could also just continue using multierr on those for now and
I think we can continue to use multierr
for that.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Description:
Replaces
go.uber.org/multierr
byerrors.Join
.Link to tracking Issue: Fixes #8210