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:
16
16
extends : .test:linux:x64
17
17
stage : gatekeeper
18
18
variables :
19
- GOVERSION : ' 1.20 '
19
+ GOVERSION : ' 1.17 '
20
20
21
21
test:linux:x64:old :
22
22
extends : .test:linux:x64
Original file line number Diff line number Diff line change @@ -5,13 +5,24 @@ set -eu
5
5
script_dir=$( cd " $( dirname " $0 " ) " ; pwd -P )
6
6
cd " ${script_dir} /.." # move to project root dir
7
7
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"
13
22
fi
14
23
24
+ echo " ******** Testing: go vet ********"
15
25
go vet ./...
16
26
27
+ echo " ******** Testing: go test ********"
17
28
go test " $@ " ./...
You can’t perform that action at this time.
0 commit comments