Skip to content

Support excludes for functions with type parameters#278

Merged
kisielk merged 3 commits into
kisielk:masterfrom
konradreiche:type-parameters
May 12, 2026
Merged

Support excludes for functions with type parameters#278
kisielk merged 3 commits into
kisielk:masterfrom
konradreiche:type-parameters

Conversation

@konradreiche
Copy link
Copy Markdown
Contributor

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 🙂

konradreiche and others added 3 commits April 27, 2026 11:45
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.
@kisielk
Copy link
Copy Markdown
Owner

kisielk commented May 12, 2026

Thanks, this will do for now. Might be worth looking into more specialized handling for errors.AsType in the future.

@kisielk kisielk merged commit 4d54a96 into kisielk:master May 12, 2026
2 checks passed
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.

2 participants