From 059eb64c9b08efa276786e777fe90b6b9666af53 Mon Sep 17 00:00:00 2001 From: LiHui Date: Wed, 21 Jul 2021 15:35:32 +0800 Subject: [PATCH 1/2] go build with vendor Signed-off-by: LiHui --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 401e49b80..8b159fd73 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,10 @@ GOBIN=$(shell go env GOBIN) endif OUTPUT_DIR=bin -GOFLAGS=-mod=vendor +ifeq (${GOFLAGS},) + # go build with vendor by default. + export GOFLAGS=-mod=vendor +endif define ALL_HELP_INFO # Build code. # From 1b5590d3dda17d817ca28db8000e25f0133f546c Mon Sep 17 00:00:00 2001 From: LiHui Date: Wed, 21 Jul 2021 16:23:36 +0800 Subject: [PATCH 2/2] downloads vendor for hack/tools --- hack/verify-spelling.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hack/verify-spelling.sh b/hack/verify-spelling.sh index f43626e7c..56eb395f9 100644 --- a/hack/verify-spelling.sh +++ b/hack/verify-spelling.sh @@ -31,6 +31,8 @@ PATH="${GOBIN}:${PATH}" # Install tools we need pushd "${KUBE_ROOT}/hack/tools" >/dev/null + # As GOFLAGS may equal to `-mod=vendor`, we must download the modules to vendor or go install will fail. + go mod vendor GO111MODULE=on go install github.com/client9/misspell/cmd/misspell popd >/dev/null