tests: fail when "make mod-check" detects a modified go.mod file

`go mod verify` does not fail when all moduled under vendor/ are
updated. However it does update `go.mod` in case it does not reflect the
downloaded versions.

By adding this additional verification in `make mod-check`, future
updates to vendor/ will require a correct go.mod as well.

Signed-off-by: Niels de Vos <ndevos@redhat.com>
(cherry picked from commit 22c0baa4b0)
This commit is contained in:
Niels de Vos 2020-04-20 11:46:01 +02:00 committed by mergify[bot]
parent 917a75de99
commit f766bb37e5

View File

@ -55,7 +55,8 @@ go-test:
./scripts/test-go.sh ./scripts/test-go.sh
mod-check: mod-check:
go mod verify @echo 'running: go mod verify'
@go mod verify && [ "$(shell sha512sum go.mod)" = "`sha512sum go.mod`" ] || ( echo "ERROR: go.mod was modified by 'go mod verify'" && false )
static-check: static-check:
./scripts/lint-go.sh ./scripts/lint-go.sh