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
Comma in exclude pattern leads to unexpected results #665
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The problem is related to the custom parsing of slice flags: golangci-lint/pkg/commands/executor.go Line 122 in 5d10450
golangci-lint/pkg/commands/run.go Lines 298 to 319 in 5d10450
|
Bug Report
I tried to configure an exclude pattern to get rid of some goconst errors. These errors take the form of
So I made an exclude filter like this:
and then noticed that all goconst errors disappeared. After adding some debugging statements to the code, I could see that the final assembled regex is
Notice how the comma turned the exclusion pattern into two distinct elements. The documentation in the readme just says
I don't really know why this is tagged as a mapstructure in the code, but right now the behaviour or the documentation is misleading.
Version of golangci-lint:
1.17.1 or master branch
Config file:
cat .golangci.yml
Go environment:
go version && go env
cc @alvaroaleman
The text was updated successfully, but these errors were encountered: