Replace golint with staticcheck#204
Open
samherrmann wants to merge 1 commit into
Open
Conversation
samherrmann
commented
Aug 15, 2023
| @@ -1,3 +1,4 @@ | |||
| // Package generate demonstrates how to use moq with the go:generate directive. | |||
Contributor
Author
There was a problem hiding this comment.
Note that I wrote the same description for this package and the example package. It's actually not clear to me what the difference is between these two packages.
d1042e5 to
d0a13d0
Compare
d0a13d0 to
95532d0
Compare
sudo-suhas
approved these changes
Aug 15, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
In my last pull request (#203), I happened to notice that there were a good number of errors in the Lint step of the CI pipeline. This observation made me wonder why all these errors existed while the pipeline still passed. What I learned is that the golint command is missing the -set_exit_status flag that would truly enforce linting rules.
Solution
One solution to the issue is to add the
-set_exit_statusflag in the pipeline and fix any outstanding linting issues. However, it should also be noted that golint was deprecated on May 9, 2021 andstaticcheckis called out as a replacement. Therefore, the better long term solution might be to replacegolintwithstaticcheck.Consider this pull request as a proposal. If you'd rather stick with
golintand address the errors it reports then let me know and I can take a look at that instead.