-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
feat: replace multierror with stdlib errors wrapping #41043
base: main
Are you sure you want to change the base?
Conversation
replace multierror library with stdlib error wrapping
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
|
@kruskall can we also remove the use of "github.com/pkg/errors"? |
Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
@@ -108,8 +108,7 @@ func (lo *IPv6Loopback) AddRandomAddress() (addr net.IP, err error) { | |||
if err = unix.Bind(fd, &bindAddr); err == nil { | |||
break | |||
} | |||
//nolint:errorlint // ignore | |||
if errno, ok := err.(unix.Errno); !ok || errno != unix.EADDRNOTAVAIL { | |||
if !errors.Is(err, unix.EADDRNOTAVAIL) { |
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.
:old-man-shouting-at-clouds: x/sys/unix has two instances of %w (both in code generators rather than lib code) and AFAICS no other form of error wrapping (it would be very strange if a package that sits at this level of the stack did). While not bound by go1compat or semver, it would be extremely surprising if this ever changed since code is copied from x/sys/unix into the std tree. But if it keeps people happy…
a5717bb
to
31eaecc
Compare
@elastic/app-search-team @elastic/obs-infraobs-integrations @elastic/stack-monitoring friendly ping for review 🙂 |
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.
LGTM for Stack Monitoring. Added a note for a line I happened to see due to required-by-linter changes.
entryValues := v.Value.(map[string]interface{}) | ||
constructEvents(entryValues, v, mbeanEvents, mapping, errs) | ||
entryValues, ok := v.Value.(map[string]interface{}) | ||
if ok { |
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.
Not my code to say so either way, but I wonder if this needs an else
to add an error?
Proposed commit message
replace multierror library with stdlib error wrapping
Go 1.20 added errors.Join allowing for multierrors. Replace go-multierror usage with native go errors
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs