Errorf asserts that a function returned an error (i.e. not `nil`). actualObj, err := SomeFunction() assert.Errorf(t, err, "error message %s", "formatted")
(t TestingT, err error, msg string, args ...interface{})
| 129 | // actualObj, err := SomeFunction() |
| 130 | // assert.Errorf(t, err, "error message %s", "formatted") |
| 131 | func Errorf(t TestingT, err error, msg string, args ...interface{}) bool { |
| 132 | if h, ok := t.(tHelper); ok { |
| 133 | h.Helper() |
| 134 | } |
| 135 | return Error(t, err, append([]interface{}{msg}, args...)...) |
| 136 | } |
| 137 | |
| 138 | // ErrorAsf asserts that at least one of the errors in err's chain matches target, and if so, sets target to that error value. |
| 139 | // This is a wrapper for errors.As. |