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{})
| 152 | // actualObj, err := SomeFunction() |
| 153 | // a.EqualError(err, expectedErrorString) |
| 154 | func (a *Assertions) EqualError(theError error, errString string, msgAndArgs ...interface{}) bool { |
| 155 | if h, ok := a.t.(tHelper); ok { |
| 156 | h.Helper() |
| 157 | } |
| 158 | return EqualError(a.t, theError, errString, msgAndArgs...) |
| 159 | } |
| 160 | |
| 161 | // EqualErrorf asserts that a function returned an error (i.e. not `nil`) |
| 162 | // and that it is equal to the provided error. |