File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ gatekeeper-test:
1616 extends : .test:linux:x64
1717 stage : gatekeeper
1818 variables :
19- GOVERSION : ' 1.20 '
19+ GOVERSION : ' 1.17 '
2020
2121test:linux:x64:old :
2222 extends : .test:linux:x64
Original file line number Diff line number Diff line change @@ -5,13 +5,24 @@ set -eu
55script_dir=$( cd " $( dirname " $0 " ) " ; pwd -P )
66cd " ${script_dir} /.." # move to project root dir
77
8- unformatted_files=$( gofmt -l .)
9- if [[ ${unformatted_files} ]]; then
10- echo " Some files are not formatted properly. You can use \` gofmt -l -w .\` to fix them:"
11- printf " %s\n" " ${unformatted_files} "
12- exit 1
8+ go_version=$( go version)
9+ echo $go_version
10+ if [[ $go_version == * go1.17.* ]]; then # Keep in sync with our CI gatekeeper job; TODO update to latest
11+ # gofmt is version specific, so only run this for our reference version for development
12+ echo " Reference Go version found for gofmt; checking source format..."
13+ echo " ******** Testing: gofmt ********"
14+ unformatted_files=$( gofmt -l .)
15+ if [[ ${unformatted_files} ]]; then
16+ echo " Some files are not formatted properly. You can use \` gofmt -l -w .\` to fix them:"
17+ printf " %s\n" " ${unformatted_files} "
18+ exit 1
19+ fi
20+ else
21+ echo " The found Go version is not our reference for gofmt; skipping source format check"
1322fi
1423
24+ echo " ******** Testing: go vet ********"
1525go vet ./...
1626
27+ echo " ******** Testing: go test ********"
1728go test " $@ " ./...
You can’t perform that action at this time.
0 commit comments