assert.ErrorAs: confusing error message #1343
Labels
pkg-assert
Change related to package testify/assert
type-error
Issue related to comparing values implementing the error interface
Typically, the target passed to
errors.As
has a zero value. But if theerrors.As
call is wrapped byassert.ErrorAs
, this can lead to a confusing error message if the assertion fails:For
expected:
, it's printing the target. But in my case the target can't be printed until it's assigned a value, and I think printing the target is not useful anyway - I think what it should be doing instead is printing the type of the target:Here's the code I used:
I am happy to submit a PR to address this.
The text was updated successfully, but these errors were encountered: