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

Method ErrorAsf

assert/assertion_forward.go:265–270  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

263// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
264// This is a wrapper for errors.As.
265func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool {
266 if h, ok := a.t.(tHelper); ok {
267 h.Helper()
268 }
269 return ErrorAsf(a.t, err, target, msg, args...)
270}
271
272// ErrorContains asserts that a function returned an error (i.e. not `nil`)
273// and that the error contains the specified substring.

Callers

nothing calls this directly

Calls 2

ErrorAsfFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected