diff --git a/Makefile b/Makefile index e9297975bb..b7c4e985e0 100644 --- a/Makefile +++ b/Makefile @@ -134,7 +134,7 @@ test-verbose: ginkgo-set tidy-vendor @go test $(GO_BUILD_FLAGS) -v ./... --race --bench=. -cover --count=1 --vet=all format: - gofmt -l -w pkg/ cmd/ + gofmt -e -d -s -l -w pkg/ cmd/ golint: ./hack/golint.sh diff --git a/automation/presubmit-tests/gofmt.sh b/automation/presubmit-tests/gofmt.sh index 3fad71a1a0..9dd7b190fe 100755 --- a/automation/presubmit-tests/gofmt.sh +++ b/automation/presubmit-tests/gofmt.sh @@ -21,7 +21,7 @@ set -e echo "Checking go format" sources="pkg/ cmd/" -unformatted=$(gofmt -l $sources) +unformatted=$(gofmt -e -d -s -l $sources) if [ ! -z "$unformatted" ]; then # Some files are not gofmt. echo >&2 "The following Go files must be formatted with gofmt:"