diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh index 50af1edae..a18f54e94 100755 --- a/.travis.gofmt.sh +++ b/.travis.gofmt.sh @@ -1,6 +1,13 @@ #!/bin/bash -if [ -n "$(gofmt -l .)" -o $(golint ./... | wc | awk '{print $1}') -gt "2" ]; then +echo $(golint ./... | wc | awk '{print $1}') + +if [ $(golint ./... | wc | awk '{print $1}') -gt 2 ]; then + echo "Go code is not formatted:" + gofmt -d . + exit 1 +fi +if [ -n "$(gofmt -l .)" ]; then echo "Go code is not formatted:" gofmt -d . exit 1