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

Method ErrorAsf

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

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.
266func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) {
267 if h, ok := a.t.(tHelper); ok {
268 h.Helper()
269 }
270 ErrorAsf(a.t, err, target, msg, args...)
271}
272
273// ErrorContains asserts that a function returned an error (i.e. not `nil`)
274// 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