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{})
| 309 | // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. |
| 310 | // This is a wrapper for errors.As. |
| 311 | func ErrorAsf(t TestingT, err error, target interface{}, msg string, args ...interface{}) { |
| 312 | if h, ok := t.(tHelper); ok { |
| 313 | h.Helper() |
| 314 | } |
| 315 | if assert.ErrorAsf(t, err, target, msg, args...) { |
| 316 | return |
| 317 | } |
| 318 | t.FailNow() |
| 319 | } |
| 320 | |
| 321 | // ErrorContains asserts that a function returned an error (i.e. not `nil`) |
| 322 | // and that the error contains the specified substring. |