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

Function NoError

internal/testify/assert/assertions.go:1544–1553  ·  view source on GitHub ↗

* Errors */ NoError asserts that a function returned no error (i.e. `nil`). actualObj, err := SomeFunction() if assert.NoError(t, err) { assert.Equal(t, expectedObj, actualObj) }

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

Source from the content-addressed store, hash-verified

1542// assert.Equal(t, expectedObj, actualObj)
1543// }
1544func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool {
1545 if err != nil {
1546 if h, ok := t.(tHelper); ok {
1547 h.Helper()
1548 }
1549 return Fail(t, fmt.Sprintf("Received unexpected error:\n%+v", err), msgAndArgs...)
1550 }
1551
1552 return true
1553}
1554
1555// Error asserts that a function returned an error (i.e. not `nil`).
1556//

Callers 15

TestFastCallFunction · 0.92
TestFunctionFunction · 0.92
TestEval_nil_in_mapsFunction · 0.92
TestIssue432Function · 0.92
TestCheckFunction · 0.92
TestCheck_FloatVsIntFunction · 0.92
TestCheck_IntSumsFunction · 0.92
TestVisitor_ConstantNodeFunction · 0.92

Calls 3

SprintfMethod · 0.80
FailFunction · 0.70
HelperMethod · 0.45

Tested by 15

TestFastCallFunction · 0.74
TestFunctionFunction · 0.74
TestEval_nil_in_mapsFunction · 0.74
TestIssue432Function · 0.74
TestCheckFunction · 0.74
TestCheck_FloatVsIntFunction · 0.74
TestCheck_IntSumsFunction · 0.74
TestVisitor_ConstantNodeFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…