From 5c4a395c525f7883b385a0f22fb30321df287fd6 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 28 Jan 2022 11:35:36 +0100 Subject: [PATCH] scripts/vendor: run go mod tidy when vendoring There was some debate about this, and wether or not tidy should be run when vendoring, but without this, validation failed after running `make vendor`, and manually doing a `go mod tidy` is complicated (due to the `vendor.mod`, and because the cache is not inside the build-cache, not on the host). Signed-off-by: Sebastiaan van Stijn --- scripts/vendor | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/vendor b/scripts/vendor index 00f79c0b3a..83f51f628c 100755 --- a/scripts/vendor +++ b/scripts/vendor @@ -21,11 +21,10 @@ go 1.16 EOL update() { - (set -x ; go mod vendor -modfile=vendor.mod) + (set -x ; go mod tidy -modfile=vendor.mod; go mod vendor -modfile=vendor.mod) } validate() { - (set -x ; go mod tidy -modfile=vendor.mod) diff=$(git status --porcelain -- vendor.mod vendor.sum vendor) if [ -n "$diff" ]; then echo >&2 'ERROR: Vendor result differs. Please vendor your package with "make -f docker.Makefile vendor"'