mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 01:38:10 +00:00
vendor: Update vendor logic
This commit is contained in:
parent
c6ac5cbc87
commit
4ca64b85f0
1540 changed files with 265304 additions and 91616 deletions
29
vendor/github.com/pkg/errors/cause.go
generated
vendored
Normal file
29
vendor/github.com/pkg/errors/cause.go
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// +build !go1.13
|
||||
|
||||
package errors
|
||||
|
||||
// Cause recursively unwraps an error chain and returns the underlying cause of
|
||||
// the error, if possible. An error value has a cause if it implements the
|
||||
// following interface:
|
||||
//
|
||||
// type causer interface {
|
||||
// Cause() error
|
||||
// }
|
||||
//
|
||||
// If the error does not implement Cause, the original error will
|
||||
// be returned. If the error is nil, nil will be returned without further
|
||||
// investigation.
|
||||
func Cause(err error) error {
|
||||
type causer interface {
|
||||
Cause() error
|
||||
}
|
||||
|
||||
for err != nil {
|
||||
cause, ok := err.(causer)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
err = cause.Cause()
|
||||
}
|
||||
return err
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue