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)