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{})
| 312 | // ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. |
| 313 | // This is a wrapper for errors.As. |
| 314 | func ErrorAs(t TestingT, err error, target interface{}, msgAndArgs ...interface{}) { |
| 315 | if h, ok := t.(tHelper); ok { |
| 316 | h.Helper() |
| 317 | } |
| 318 | if assert.ErrorAs(t, err, target, msgAndArgs...) { |
| 319 | return |
| 320 | } |
| 321 | t.FailNow() |
| 322 | } |
| 323 | |
| 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. |