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

Function NoErrorf

assert/assertion_format.go:561–566  ·  view source on GitHub ↗

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

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

Source from the content-addressed store, hash-verified

559// assert.Equal(t, expectedObj, actualObj)
560// }
561func NoErrorf(t TestingT, err error, msg string, args ...interface{}) bool {
562 if h, ok := t.(tHelper); ok {
563 h.Helper()
564 }
565 return NoError(t, err, append([]interface{}{msg}, args...)...)
566}
567
568// NoFileExistsf checks whether a file does not exist in a given path. It fails
569// if the path points to an existing _file_ only.

Callers 2

NoErrorfFunction · 0.92
NoErrorfMethod · 0.70

Calls 2

NoErrorFunction · 0.70
HelperMethod · 0.65

Tested by

no test coverage detected