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{})
| 559 | // assert.Equal(t, expectedObj, actualObj) |
| 560 | // } |
| 561 | func 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. |