Skip to content

Conversation

jinnovation
Copy link
Contributor

This modification is useful in cases where we want to assert equality against
some exported error value, e.g. assert.EqualError(t, err, pkg.ErrSomeError),
letting us avoid the unnecessary error "dereference" to string.

This modification is useful in cases where we want to assert equality against
some exported error value, e.g. `assert.EqualError(t, err, pkg.ErrSomeError)`,
letting us avoid the unnecessary error "dereference" to string.
@jinnovation jinnovation reopened this Jun 13, 2018
@slizco
Copy link

slizco commented Jan 2, 2019

I'd also like to see this PR included. As an addition, it'd be nice for the assertion to return true if both the expected and actual errors passed equate to nil (in the case where an error is passed for expected value instead of string). This should still be a non-breaking change.

@georgelesica-wf
Copy link

Are there any tests that can be updated just to exercise the new code path?

@jinnovation
Copy link
Contributor Author

Are there any tests that can be updated just to exercise the new code path?

Happy to look into it and update accordingly.

@glesica
Copy link
Collaborator

glesica commented Feb 7, 2020

Is this still a desirable change? I'm going to move it to the release after the next release since it won't be a breaking change and then we can push out the next release sooner.

@glesica glesica modified the milestones: Next, Next + 1 Feb 7, 2020
@jinnovation
Copy link
Contributor Author

I'm going to move it to the release after the next release since it won't be a breaking change and then we can push out the next release sooner.

Sounds good.

@jinnovation
Copy link
Contributor Author

ErrorIs was added in v1.7.0 that supersedes this horridly stale PR of mine. 😇 Closing.

@jinnovation jinnovation deleted the equal-error branch August 26, 2022 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants