From 0a49689e71b749aba87d20aee77b55774f2632a9 Mon Sep 17 00:00:00 2001 From: Matt Dale <9760375+matthewdale@users.noreply.github.com> Date: Thu, 25 Apr 2024 14:49:33 -0700 Subject: [PATCH] Run `go mod tidy` before vendoring in compilecheck. (#1620) --- etc/compile_check.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/etc/compile_check.sh b/etc/compile_check.sh index 3815d19f3a..397322f2bf 100755 --- a/etc/compile_check.sh +++ b/etc/compile_check.sh @@ -20,19 +20,18 @@ function compile_check { # Change the directory to the compilecheck test directory. cd ${COMPILE_CHECK_DIR} + # If the Go version is 1.15 or greater, then run "go mod tidy". + MACHINE_VERSION=`${GC} version | { read _ _ v _; echo ${v#go}; }` + if [ $(version $MACHINE_VERSION) -ge $(version 1.15) ]; then + go mod tidy + fi + # Test vendoring go mod vendor ${GC} build -mod=vendor rm -rf vendor - MACHINE_VERSION=`${GC} version | { read _ _ v _; echo ${v#go}; }` - - # If the version is not 1.13, then run "go mod tidy" - if [ $(version $MACHINE_VERSION) -ge $(version 1.15) ]; then - go mod tidy - fi - # Check simple build. ${GC} build ./...