ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. This is a wrapper for errors.As.
(err error, target interface{}, msg string, args ...interface{})
| 263 | // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. |
| 264 | // This is a wrapper for errors.As. |
| 265 | func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool { |
| 266 | if h, ok := a.t.(tHelper); ok { |
| 267 | h.Helper() |
| 268 | } |
| 269 | return ErrorAsf(a.t, err, target, msg, args...) |
| 270 | } |
| 271 | |
| 272 | // ErrorContains asserts that a function returned an error (i.e. not `nil`) |
| 273 | // and that the error contains the specified substring. |