ErrorIs asserts that at least one of the errors in err's chain matches target. This is a wrapper for errors.Is.
(t TestingT, err error, target error, msgAndArgs ...interface{})
| 366 | // ErrorIs asserts that at least one of the errors in err's chain matches target. |
| 367 | // This is a wrapper for errors.Is. |
| 368 | func ErrorIs(t TestingT, err error, target error, msgAndArgs ...interface{}) { |
| 369 | if h, ok := t.(tHelper); ok { |
| 370 | h.Helper() |
| 371 | } |
| 372 | if assert.ErrorIs(t, err, target, msgAndArgs...) { |
| 373 | return |
| 374 | } |
| 375 | t.FailNow() |
| 376 | } |
| 377 | |
| 378 | // ErrorIsf asserts that at least one of the errors in err's chain matches target. |
| 379 | // This is a wrapper for errors.Is. |