From 95427edbbaa37bc9a62567e7066bcab6181ccec1 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 9 May 2017 15:11:17 +0800 Subject: [PATCH] update makefile Signed-off-by: Bo-Yi Wu --- Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 93247e6..7a66f1a 100644 --- a/Makefile +++ b/Makefile @@ -31,12 +31,13 @@ all: build .PHONY: fmt-check fmt-check: - # get all go files and run go fmt on them - @files=$$($(GOFILES) | xargs $(GOFMT) -l); if [ -n "$$files" ]; then \ + # get all go files and run go fmt on them + @diff=$$($(GOFMT) -d $(GOFILES)); \ + if [ -n "$$diff" ]; then \ echo "Please run 'make fmt' and commit the result:"; \ - echo "$${files}"; \ + echo "$${diff}"; \ exit 1; \ - fi; + fi; fmt: $(GOFMT) -w $(GOFILES)