mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Revert "Implement Is() for multierrors"
This commit is contained in:
parent
f7f1fc750c
commit
d69082ea9a
|
@ -16,7 +16,6 @@ package errors
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
)
|
)
|
||||||
|
@ -80,19 +79,6 @@ func (es nonNilMultiError) Error() string {
|
||||||
return buf.String()
|
return buf.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is attempts to match the provided error against errors in the error list.
|
|
||||||
//
|
|
||||||
// This function allows errors.Is to traverse the values stored in the MultiError.
|
|
||||||
// It returns true if any of the errors in the list match the target.
|
|
||||||
func (es nonNilMultiError) Is(target error) bool {
|
|
||||||
for _, err := range es.errs {
|
|
||||||
if errors.Is(err, target) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// CloseAll closes all given closers while recording error in MultiError.
|
// CloseAll closes all given closers while recording error in MultiError.
|
||||||
func CloseAll(cs []io.Closer) error {
|
func CloseAll(cs []io.Closer) error {
|
||||||
errs := NewMulti()
|
errs := NewMulti()
|
||||||
|
|
Loading…
Reference in a new issue