Skip to content

Support excludes for functions with type parameters#278

Open
konradreiche wants to merge 2 commits intokisielk:masterfrom
konradreiche:type-parameters
Open

Support excludes for functions with type parameters#278
konradreiche wants to merge 2 commits intokisielk:masterfrom
konradreiche:type-parameters

Conversation

@konradreiche
Copy link
Copy Markdown

Go 1.26 added errors.AsType, which can appears as:

_, ok := errors.AsType[*SomeError](err)

An exclusion file entry for errors.AsType currently does not match this form, as described in #274. This change unwraps type parameters and parenthesized expressions before matching selectors or identifiers for exclusions.

Not sure if exclusions are the preferred long-term fix here, or if errors.AsType should get more targeted handling. I kept this change narrow, but happy to adjust if there's a better direction 🙂

Go 1.26 added errors.AsType, which can appear as:

    _, ok := errors.AsType[*SomeError](err)

An exclusion file entry for errors.AsType currently does not match this
form, as described in kisielk#274. This change unwraps type parameters and
parenthesized expressions before matching selectors or identifiers for
exclusions.
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.

1 participant