MCPcopy
hub / github.com/stretchr/testify / ErrorIsf

Function ErrorIsf

require/require.go:380–388  ·  view source on GitHub ↗

ErrorIsf 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, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

378// ErrorIsf asserts that at least one of the errors in err's chain matches target.
379// This is a wrapper for errors.Is.
380func ErrorIsf(t TestingT, err error, target error, msg string, args ...interface{}) {
381 if h, ok := t.(tHelper); ok {
382 h.Helper()
383 }
384 if assert.ErrorIsf(t, err, target, msg, args...) {
385 return
386 }
387 t.FailNow()
388}
389
390// Errorf asserts that a function returned an error (i.e. not `nil`).
391//

Callers 1

ErrorIsfMethod · 0.70

Calls 3

ErrorIsfFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected