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 <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-01-28 11:35:36 +01:00
parent 2b0e74c207
commit 5c4a395c52
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 1 additions and 2 deletions

View File

@ -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"'