1. Use gofmt to format the code:
git ls-files \*.go | grep -Ev '/?vendor/' | xargs gofmt -w -s
2. Add gofmt to golangci-lint (it's not enabled by default).
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
... and its dependencies.
Also, modify .golangci.yml since new golangci-lint no longer have some
of the linters mentioned. Besides, it is unsafe to enable all linters,
because (1) not all linters are good/useful; (2) new golangci-lint
releases can bring more linters and thus more CI issues. Instead, use
the default set of linters, plus enable a few more:
* revive (which replaces golint)
* unconvert
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
When we carried over the linting configuration from podman, we carried
over the list of checkers that were disabled for podman's sake, even
ones that don't complain about the code in this repository.
Make trivial changes to make gosimple happy.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Update golangci-lint to v1.18.0. Purely out of neccessity to get the
tests/tools/go.mod into a working state. The previous version had a
non-existent dependency which broke all attempts to do anything.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
For some reason, this particular check causes the process to be killed
after some amount of time. No error message is displayed, with or
without `--verbose`. Disable the check with an explanatory comment.
Signed-off-by: Chris Evich <cevich@redhat.com>
This commit enabled to golint linter in golangci-lint and applies all
necessary fixes.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Closes: #1740
Approved by: rhatdan
This commit enabled the `unparam` linter and applies all reported issues.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Closes: #1719
Approved by: rhatdan
This commit enabled the errcheck linter and fixes an uncovered stat to
`os.DevNull`. Beside this, we disable go modules within the
`tests/tools/Makefile` to allow independent offline builds.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Closes: #1713
Approved by: vrothberg
This enabled the `bodyclose` linter and fixes the reported response body
resource leak.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Closes: #1711
Approved by: nalind
This commit vendors golangci-lint and enables all linters which do not
complain right now. CI and scripting has been adapted as well.
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
Closes: #1706
Approved by: rhatdan