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

Method Error

assert/assertion_forward.go:247–252  ·  view source on GitHub ↗

Error asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() a.Error(err)

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

Source from the content-addressed store, hash-verified

245// actualObj, err := SomeFunction()
246// a.Error(err)
247func (a *Assertions) Error(err error, msgAndArgs ...interface{}) bool {
248 if h, ok := a.t.(tHelper); ok {
249 h.Helper()
250 }
251 return Error(a.t, err, msgAndArgs...)
252}
253
254// ErrorAs asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
255// This is a wrapper for errors.As.

Callers

nothing calls this directly

Calls 2

ErrorFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected