Browse Source

Merge pull request #43212 from thaJeztah/fix_vendor

hack/vendor.sh: run "go mod tidy" before vendoring
Sebastiaan van Stijn 3 năm trước cách đây
mục cha
commit
36313c4bdb
2 tập tin đã thay đổi với 2 bổ sung7 xóa
  1. 0 6
      hack/validate/vendor
  2. 2 1
      hack/vendor.sh

+ 0 - 6
hack/validate/vendor

@@ -3,11 +3,6 @@
 SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 source "${SCRIPTDIR}/.validate"
 
-go_mod_tidy(){
-	${SCRIPTDIR}/../go-mod-prepare.sh
-	GO111MODULE=auto go mod tidy -modfile 'vendor.mod' -compat 1.17
-}
-
 validate_vendor_diff(){
 	IFS=$'\n'
 	check_files=( 'vendor.sum' 'vendor.mod' 'vendor/' )
@@ -54,6 +49,5 @@ validate_vendor_used() {
 	done
 }
 
-go_mod_tidy
 validate_vendor_diff
 validate_vendor_used

+ 2 - 1
hack/vendor.sh

@@ -8,9 +8,10 @@ set -e
 set -x
 
 SCRIPTDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-${SCRIPTDIR}/go-mod-prepare.sh
+"${SCRIPTDIR}"/go-mod-prepare.sh
 
 if [ $# -eq 0 ] || [ "$1" != "archive/tar" ]; then
+	GO111MODULE=auto go mod tidy -modfile 'vendor.mod' -compat 1.17
 	GO111MODULE=auto go mod vendor -modfile vendor.mod
 fi