From 4ce0e91035da9e5116faaa5faed462b802ebd58e Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 13 Oct 2017 14:32:20 +0100 Subject: [PATCH] local-check: fail build if gofmt detects differences It seems to exit code 0 in all cases. Signed-off-by: Ian Campbell --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 42a9841d4..35ab3cbe3 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ test-cross: .PHONY: local-check local-build local-test local local-check: $(LINUXKIT_DEPS) - @echo gofmt... && gofmt -s -l $(filter %.go,$(LINUXKIT_DEPS)) + @echo gofmt... && o=$$(gofmt -s -l $(filter %.go,$(LINUXKIT_DEPS))) && if [ -n "$$o" ] ; then echo $$o ; exit 1 ; fi @echo govet... && go tool vet -printf=false $(filter %.go,$(LINUXKIT_DEPS)) @echo golint... && set -e ; for i in $(filter %.go,$(LINUXKIT_DEPS)); do golint $$i ; done @echo ineffassign... && ineffassign $(filter %.go,$(LINUXKIT_DEPS))