I don't see any difference to use in testing EqualError vs Equal. my question is What does EqualError extra?
EqualError
Equal
As stated in the documentation, EqualError takes error as its 2nd and third arguments, while Equal takes any.
error
any
When checking the value of an error, you should use EqualError. If not, use Equal.
As stated in the documentation,
EqualError
takeserror
as its 2nd and third arguments, whileEqual
takesany
.When checking the value of an
error
, you should useEqualError
. If not, useEqual
.