Blame vendor/github.com/pkg/errors/go113.go

Packit Service 509fd4
// +build go1.13
Packit Service 509fd4
Packit Service 509fd4
package errors
Packit Service 509fd4
Packit Service 509fd4
import (
Packit Service 509fd4
	stderrors "errors"
Packit Service 509fd4
)
Packit Service 509fd4
Packit Service 509fd4
// Is reports whether any error in err's chain matches target.
Packit Service 509fd4
//
Packit Service 509fd4
// The chain consists of err itself followed by the sequence of errors obtained by
Packit Service 509fd4
// repeatedly calling Unwrap.
Packit Service 509fd4
//
Packit Service 509fd4
// An error is considered to match a target if it is equal to that target or if
Packit Service 509fd4
// it implements a method Is(error) bool such that Is(target) returns true.
Packit Service 509fd4
func Is(err, target error) bool { return stderrors.Is(err, target) }
Packit Service 509fd4
Packit Service 509fd4
// As finds the first error in err's chain that matches target, and if so, sets
Packit Service 509fd4
// target to that error value and returns true.
Packit Service 509fd4
//
Packit Service 509fd4
// The chain consists of err itself followed by the sequence of errors obtained by
Packit Service 509fd4
// repeatedly calling Unwrap.
Packit Service 509fd4
//
Packit Service 509fd4
// An error matches target if the error's concrete value is assignable to the value
Packit Service 509fd4
// pointed to by target, or if the error has a method As(interface{}) bool such that
Packit Service 509fd4
// As(target) returns true. In the latter case, the As method is responsible for
Packit Service 509fd4
// setting target.
Packit Service 509fd4
//
Packit Service 509fd4
// As will panic if target is not a non-nil pointer to either a type that implements
Packit Service 509fd4
// error, or to any interface type. As returns false if err is nil.
Packit Service 509fd4
func As(err error, target interface{}) bool { return stderrors.As(err, target) }
Packit Service 509fd4
Packit Service 509fd4
// Unwrap returns the result of calling the Unwrap method on err, if err's
Packit Service 509fd4
// type contains an Unwrap method returning error.
Packit Service 509fd4
// Otherwise, Unwrap returns nil.
Packit Service 509fd4
func Unwrap(err error) error {
Packit Service 509fd4
	return stderrors.Unwrap(err)
Packit Service 509fd4
}