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

Function Errorf

internal/testify/assert/assertion_format.go:124–129  ·  view source on GitHub ↗

Errorf asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() if assert.Errorf(t, err, "error message %s", "formatted") { assert.Equal(t, expectedErrorf, err) }

(t TestingT, err error, msg string, args ...interface{})

Source from the content-addressed store, hash-verified

122// assert.Equal(t, expectedErrorf, err)
123// }
124func Errorf(t TestingT, err error, msg string, args ...interface{}) bool {
125 if h, ok := t.(tHelper); ok {
126 h.Helper()
127 }
128 return Error(t, err, append([]interface{}{msg}, args...)...)
129}
130
131// ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value.
132// This is a wrapper for errors.As.

Callers 3

ErrorfFunction · 0.92
TestErrorFunction · 0.70
ErrorfMethod · 0.70

Calls 2

ErrorFunction · 0.70
HelperMethod · 0.45

Tested by 1

TestErrorFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…