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

Method ErrorAs

require/require_forward.go:257–262  ·  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.

(err error, target interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

255// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
256// This is a wrapper for errors.As.
257func (a *Assertions) ErrorAs(err error, target interface{}, msgAndArgs ...interface{}) {
258 if h, ok := a.t.(tHelper); ok {
259 h.Helper()
260 }
261 ErrorAs(a.t, err, target, msgAndArgs...)
262}
263
264// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
265// This is a wrapper for errors.As.

Callers

nothing calls this directly

Calls 2

ErrorAsFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected