From 22c0baa4b09e60f5964cb2a1f1cc928b89c43409 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 20 Apr 2020 11:46:01 +0200 Subject: [PATCH] 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 --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1c8f22d74..1ce24dd02 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,8 @@ go-test: ./scripts/test-go.sh 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 ) go-lint: ./scripts/lint-go.sh