This repository was archived by the owner on Sep 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +31
-8
lines changed
Expand file tree Collapse file tree 1 file changed +31
-8
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- # Install tools to test our code-quality .
4- go get -u golang.org/x/lint/golint
3+ # I don't even . .
4+ go env -w GOFLAGS= " -buildvcs=false "
55
6- # Failures cause aborts
6+ # Install the tools we use to test our code-quality.
7+ #
8+ # Here we setup the tools to install only if the "CI" environmental variable
9+ # is not empty. This is because locally I have them installed.
10+ #
11+ # NOTE: Github Actions always set CI=true
12+ #
13+ if [ -n " ${CI} " ] ; then
14+ go install golang.org/x/lint/golint@latest
15+ go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
16+ go install honnef.co/go/tools/cmd/staticcheck@latest
17+ fi
18+
19+ # Run the static-check tool
20+ t=$( mktemp)
21+ staticcheck -checks all ./... | grep -v " is deprecated" > " $t "
22+ if [ -s " $t " ]; then
23+ echo " Found errors via 'staticcheck'"
24+ cat " $t "
25+ rm " $t "
26+ exit 1
27+ fi
28+ rm " $t "
29+
30+ # At this point failures cause aborts
731set -e
832
933# Run the linter
1034echo " Launching linter .."
1135golint -set_exit_status ./...
1236echo " Completed linter .."
1337
14- # Run the vet-checker.
15- echo " Launching go vet check .."
16- go vet ./...
17- echo " Completed go vet check .."
18-
38+ # Run the shadow-checker
39+ echo " Launching shadowed-variable check .."
40+ go vet -vettool=" $( which shadow) " ./...
41+ echo " Completed shadowed-variable check .."
You can’t perform that action at this time.
0 commit comments