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

Function ErrorAs

require/require.go:314–322  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

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.
314func 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.

Callers 1

ErrorAsMethod · 0.70

Calls 3

ErrorAsFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected