File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 22set -e # exit when any command fails
33set -x # show all commands being run
44
5- : ${GO_VERSION:= " 1.18" } # Default to 1.18 if GO_VERSION is unset or empty
6- : ${GC:= go$GO_VERSION } # Use existing GC or default to "go$GO_VERSION"
5+ : ${GC:= go${GO_VERSION=" 1.18" } }
76
87COMPILE_CHECK_DIR=" internal/cmd/compilecheck"
98ARCHITECTURES=(" 386" " arm" " arm64" " ppc64le" " s390x" )
@@ -15,6 +14,16 @@ function compile_check {
1514 # Change the directory to the compilecheck test directory.
1615 pushd " ${COMPILE_CHECK_DIR} " > /dev/null
1716
17+ # If a custom Go version is set using the GO_VERSION env var (e.g. "1.18"),
18+ # add the GOPATH bin directory to PATH and then install that Go version.
19+ if [ ! -z " $GO_VERSION " ]; then
20+ PATH=$( go env GOPATH) /bin:$PATH
21+ export PATH
22+
23+ go install golang.org/dl/go$GO_VERSION @latest
24+ ${GC} download
25+ fi
26+
1827 ${GC} version
1928 ${GC} mod tidy
2029
You can’t perform that action at this time.
0 commit comments