Add `go vet -all` to our standard checks.

It checks some things that staticcheck doesn't. Notably, closing over
loop variables.

Currently none of the checks are false positives, so might as well run
them all (it takes about 2s). If we later find one we disagree with,
we can disable it.

Change-Id: Ie11b5d8fd7250f8b55b474a662fe78f139f23a6e
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/241797
Reviewed-by: Julie Qiu <julie@golang.org>
This commit is contained in:
Jonathan Amsterdam 2020-07-09 16:45:38 -04:00
Родитель 5f3d1516c2
Коммит 3aae7e77f9
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -92,6 +92,11 @@ check_unparam() {
runcmd unparam ./...
}
# check_vet runs go vet on source files.
check_vet() {
runcmd go vet -all ./...
}
# check_staticcheck runs staticcheck on source files.
check_staticcheck() {
ensure_go_binary honnef.co/go/tools/cmd/staticcheck
@ -134,6 +139,7 @@ run_prettier() {
standard_linters() {
check_headers
check_bad_migrations
check_vet
check_staticcheck
check_misspell
check_unparam