As finds the first error in err's chain that matches target, and if so, sets target to that error value and returns true. The chain consists of err itself followed by the sequence of errors obtained by repeatedly calling Unwrap. An error matches target if the error's concrete value is assignable t
(err error, target interface{})
| 29 | // As will panic if target is not a non-nil pointer to either a type that implements |
| 30 | // error, or to any interface type. As returns false if err is nil. |
| 31 | func As(err error, target interface{}) bool { return stderrors.As(err, target) } |
| 32 | |
| 33 | // Unwrap returns the result of calling the Unwrap method on err, if err's |
| 34 | // type contains an Unwrap method returning error. |