MCPcopy
hub / github.com/expr-lang/expr / ErrorAsf

Method ErrorAsf

internal/testify/assert/assertion_forward.go:249–254  ·  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

247// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
248// This is a wrapper for errors.As.
249func (a *Assertions) ErrorAsf(err error, target interface{}, msg string, args ...interface{}) bool {
250 if h, ok := a.t.(tHelper); ok {
251 h.Helper()
252 }
253 return ErrorAsf(a.t, err, target, msg, args...)
254}
255
256// ErrorContains asserts that a function returned an error (i.e. not `nil`)
257// and that the error contains the specified substring.

Callers

nothing calls this directly

Calls 2

ErrorAsfFunction · 0.70
HelperMethod · 0.45

Tested by

no test coverage detected