chore: replace make vet and fmt with golangci-lint #12
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.
In CI, this project already uses golangci-lint to configure and run all of its various linters. Run the same thing locally in "make lint" and as part of make targets that previously ran "go vet" and "go fmt". This has the added benefit of commands like "make build" and "make test" causing diffs, since it is difficut to run "go fmt" without it actually modifying files.
Add a new "golangci-lint" target that downloads a project-specific copy of golangci-lint to the project's bin directory, similar to what we do for kustomize and other tools. The version is set to v1.52.2, which is the same we have configured in CI.
Add a new "make lint" target to run the linter and get rid of the old "vet" and "fmt" targets since our lint list checks those. Also restructure the make targets and CI slightly so that when CI runs builds, it doesn't implicitly run the linter again, since it has already done so in a previous action.