EqualError asserts that a function returned an error (i.e. not `nil`) and that it is equal to the provided error. actualObj, err := SomeFunction() a.EqualError(err, expectedErrorString)
(theError error, errString string, msgAndArgs ...interface{})
| 136 | // actualObj, err := SomeFunction() |
| 137 | // a.EqualError(err, expectedErrorString) |
| 138 | func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) { |
| 139 | if h, ok := a.t.(tHelper); ok { |
| 140 | h.Helper() |
| 141 | } |
| 142 | EqualError(a.t, theError, errString, msgAndArgs...) |
| 143 | } |
| 144 | |
| 145 | // EqualErrorf asserts that a function returned an error (i.e. not `nil`) |
| 146 | // and that it is equal to the provided error. |