Skip to content
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

docs: note that exhaustruct struct regular expressions are expected to match the entire package/name/structname #4190

Merged
merged 2 commits into from
Nov 9, 2023
Merged

docs: note that exhaustruct struct regular expressions are expected to match the entire package/name/structname #4190

merged 2 commits into from
Nov 9, 2023

Conversation

magnetikonline
Copy link
Contributor

@magnetikonline magnetikonline commented Nov 9, 2023

Quick one that tripped me up recently.

With the exhaustruct linter - the list of structs to include/exclude must match the full package/name/structname - otherwise no match will be made/considered.

E.g. if I wish to target a struct of:

github.com/this/is/my/package/CoolStruct

These will work:

github\.com/this/is/my/package/CoolStruct
github\.com/this/is/my/package/Cool.+

This won't work:

github\.com/this/is/my/package/Cool
^github\.com/this/is/my/package/Cool

The source for exhauststruct helps explain this behaviour: https://github.com/GaijinEntertainment/go-exhaustruct/blob/917096e5c081c98cd2bba5ecac3d3fa1479a6029/internal/pattern/list.go#L39-L47

Hopefully this comment helps in that usage!

@ldez ldez changed the title Note that exhaustruct struct regular expressions are expected to match the entire package/name/structname docs: note that exhaustruct struct regular expressions are expected to match the entire package/name/structname Nov 9, 2023
@ldez ldez added the enhancement New feature or improvement label Nov 9, 2023
@ldez ldez merged commit 467d563 into golangci:master Nov 9, 2023
11 checks passed
Antonboom pushed a commit to Antonboom/golangci-lint that referenced this pull request Mar 3, 2024
@ldez ldez modified the milestone: v1.56 Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants