Skip to content

Conversation

@UmarFarooq-MP
Copy link

Fixes #58

This change ensures that calling Is(err) without passing any code arguments returns false. Previously Is(err) would always return true, because PrefixMatches treats empty code as a match.

The fix adds an early guard if len(code) == 0 { return false } at the start of Is. New tests have been added to assert this behavior, including nested/unwrapped errors. All existing tests continue to pass.

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.

Abnormal behaviour for Is in errors.go

1 participant