Skip to content

Double parsing having unwanted side effects. #49

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

Closed
dixonwille opened this issue Jun 1, 2018 · 3 comments
Closed

Double parsing having unwanted side effects. #49

dixonwille opened this issue Jun 1, 2018 · 3 comments
Labels
enhancement New feature or improvement

Comments

@dixonwille
Copy link

I noticed your comment here https://github.com/golangci/golangci-lint/blob/master/pkg/commands/run.go#L404 about double parsing that way you can get Viper setup with the config values. But this causes some of the flags to act as if they were passed in twice by the user. StringSlice for example will duplicate the result. Not sure if there are any other flags that are doing this.

I think a possible solution may be to call e.parseConfig inside the executeRun command. But maybe there is something I am not seeing?

@jirfag
Copy link
Contributor

jirfag commented Jun 2, 2018

Thank you! My fix is in #58, check it, please. Maybe you see ways to fix it better?

jirfag added a commit that referenced this issue Jun 2, 2018
…tions

#49: don't fill string slice 2 times because of double parsing of opt…
@dixonwille
Copy link
Author

I don't have time to check it where I was seeing the issue, right now. I may be able to get to it later today.

@jirfag
Copy link
Contributor

jirfag commented Jun 4, 2018

ok, thank you

@jirfag jirfag closed this as completed Jun 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants