diff --git a/Makefile b/Makefile
index ce2acfef14581c6b61b87a00064a8e169de63df9..a3e3772216ab9b5965797780cd7ff84ef5cbe567 100644
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,7 @@ test-unit:
 
 .PHONY: .test-style
 test-style: lint vet
-	@if [ $(shell gofmt -e -l -s $(GO_DIRS)) ]; then \
+	@if [ $(shell gofmt -e -l -s $(GO_DIRS) | wc -l) ]; then \
 		echo "gofmt check failed:"; gofmt -e -d -s $(GO_DIRS); exit 1; \
 	fi