-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is
methods should be exempt for type assertions and switches too
#50
Comments
triarius
added a commit
to triarius/go-errorlint
that referenced
this issue
Aug 2, 2023
triarius
added a commit
to triarius/go-errorlint
that referenced
this issue
Aug 2, 2023
triarius
added a commit
to triarius/go-errorlint
that referenced
this issue
Aug 15, 2023
triarius
added a commit
to triarius/go-errorlint
that referenced
this issue
Aug 15, 2023
polyfloyd
pushed a commit
that referenced
this issue
Aug 20, 2023
polyfloyd
pushed a commit
that referenced
this issue
Aug 20, 2023
tri-adam
added a commit
to tri-adam/sif
that referenced
this issue
Aug 21, 2023
As of v1.4.4, go-errorlint exempts `Is` methods from type assertions (see polyfloyd/go-errorlint#50).
DrDaveD
pushed a commit
to DrDaveD/sif
that referenced
this issue
Aug 24, 2023
As of v1.4.4, go-errorlint exempts `Is` methods from type assertions (see polyfloyd/go-errorlint#50). Signed-off-by: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When fixing #11, it was decided to make an exemption for comparisons and switches in
Is
methods. This works for errors that are atomic values, but some errors have more structure and need a more detailed comparison.For example, for an error like
we may want to do more than just compare types in an
Is
method, we may want to assert the error's codes and message match as well:If we want to provide an equivalence between errors of different types, we may also need to use the
switch
form of type assertion.with an appropriate method for
*ComplexError
as well.Currently, both forms of type assertion are warned of by go-errorlint.
The text was updated successfully, but these errors were encountered: