diff --git a/Makefile b/Makefile index 2057bc0d4..6ac173b9b 100644 --- a/Makefile +++ b/Makefile @@ -28,10 +28,7 @@ verifiers: getdeps fmt lint fmt: @echo "Running $@ check" - @GO111MODULE=on gofmt -d restapi/ - @GO111MODULE=on gofmt -d pkg/ - @GO111MODULE=on gofmt -d cmd/ - @GO111MODULE=on gofmt -d cluster/ + @(env bash $(PWD)/verify-gofmt.sh) crosscompile: @(env bash $(PWD)/cross-compile.sh $(arg1)) diff --git a/verify-gofmt.sh b/verify-gofmt.sh new file mode 100755 index 000000000..ee14df4ab --- /dev/null +++ b/verify-gofmt.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Expanding gofmt to cover more areas. +# This will include auto generated files created by Swagger. +# Catching the difference due to https://github.com/golang/go/issues/46289 +DIFF=$(GO111MODULE=on gofmt -d .) +if [[ -n $DIFF ]]; +then + echo "$DIFF"; + echo "please run gofmt"; + exit 1; +fi