Errorf asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() if a.Errorf(err, "error message %s", "formatted") { assert.Equal(t, expectedErrorf, err) }
(err error, msg string, args ...interface{})
| 302 | // assert.Equal(t, expectedErrorf, err) |
| 303 | // } |
| 304 | func (a *Assertions) Errorf(err error, msg string, args ...interface{}) bool { |
| 305 | if h, ok := a.t.(tHelper); ok { |
| 306 | h.Helper() |
| 307 | } |
| 308 | return Errorf(a.t, err, msg, args...) |
| 309 | } |
| 310 | |
| 311 | // Eventually asserts that given condition will be met in waitFor time, |
| 312 | // periodically checking target function each tick. |