ErrorAs 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{}, msgAndArgs ...interface{})
| 297 | // ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. |
| 298 | // This is a wrapper for errors.As. |
| 299 | func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) { |
| 300 | if h, ok := t.(tHelper); ok { |
| 301 | h.Helper() |
| 302 | } |
| 303 | if assert.ErrorAs(t, err, target, msgAndArgs...) { |
| 304 | return |
| 305 | } |
| 306 | t.FailNow() |
| 307 | } |
| 308 | |
| 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. |