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

Function Errorf

internal/testify/require/require.go:381–389  ·  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

379// assert.Equal(t, expectedErrorf, err)
380// }
381func Errorf(t TestingT, err error, msg string, args ...interface{}) {
382 if h, ok := t.(tHelper); ok {
383 h.Helper()
384 }
385 if assert.Errorf(t, err, msg, args...) {
386 return
387 }
388 t.FailNow()
389}
390
391// Eventually asserts that given condition will be met in waitFor time,
392// periodically checking target function each tick.

Callers 1

ErrorfMethod · 0.70

Calls 3

ErrorfFunction · 0.92
FailNowMethod · 0.65
HelperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…