Skip to content

fix: determine error interface implementation in isError - #70

Merged
tomarrell merged 2 commits into
tomarrell:masterfrom
AdamMagued:fix/issue-63-is-error-implements-interface
Oct 14, 2026
Merged

tomarrell merged 2 commits into
tomarrell:masterfrom
AdamMagued:fix/issue-63-is-error-implements-interface

Conversation

@AdamMagued

Copy link
Copy Markdown
Contributor

Fixes #63

Solution

  • Updated isError to verify whether the provided type implements the standard error interface via types.Implements.
  • Added unit tests covering custom structs and types implementing error.

Verified with test suite.

@tomarrell

Copy link
Copy Markdown
Owner

Thanks for this. It also flagged functions that return a custom error type, like func f() ext.CustomErr, where wrapping isn't possible. I've pushed a commit so it only flags them when the function returns error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Why does the isError function not determine whether the passed type implements the interface, but instead uses whether the type is error?

2 participants