Skip to content

Commit

Permalink
Run go mod tidy before vendoring in compilecheck. (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdale authored Apr 25, 2024
1 parent d2a0f99 commit 0a49689
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions etc/compile_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./...

Expand Down

0 comments on commit 0a49689

Please sign in to comment.