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.
(t TestingT, err error, target interface{}, msg string, args ...interface{})
| 324 | // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. |
| 325 | // This is a wrapper for errors.As. |
| 326 | func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) { |
| 327 | if h, ok := t.(tHelper); ok { |
| 328 | h.Helper() |
| 329 | } |
| 330 | if assert.ErrorAsf(t, err, target, msg, args...) { |
| 331 | return |
| 332 | } |
| 333 | t.FailNow() |
| 334 | } |
| 335 | |
| 336 | // ErrorContains asserts that a function returned an error (i.e. not `nil`) |
| 337 | // and that the error contains the specified substring. |