Skip to content

Commit 0a49689

Browse files
authored
Run go mod tidy before vendoring in compilecheck. (#1620)
1 parent d2a0f99 commit 0a49689

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

etc/compile_check.sh

+6-7
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,18 @@ function compile_check {
2020
# Change the directory to the compilecheck test directory.
2121
cd ${COMPILE_CHECK_DIR}
2222

23+
# If the Go version is 1.15 or greater, then run "go mod tidy".
24+
MACHINE_VERSION=`${GC} version | { read _ _ v _; echo ${v#go}; }`
25+
if [ $(version $MACHINE_VERSION) -ge $(version 1.15) ]; then
26+
go mod tidy
27+
fi
28+
2329
# Test vendoring
2430
go mod vendor
2531
${GC} build -mod=vendor
2632

2733
rm -rf vendor
2834

29-
MACHINE_VERSION=`${GC} version | { read _ _ v _; echo ${v#go}; }`
30-
31-
# If the version is not 1.13, then run "go mod tidy"
32-
if [ $(version $MACHINE_VERSION) -ge $(version 1.15) ]; then
33-
go mod tidy
34-
fi
35-
3635
# Check simple build.
3736
${GC} build ./...
3837

0 commit comments

Comments
 (0)