diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh new file mode 100644 index 000000000..962c6a542 --- /dev/null +++ b/.travis.gofmt.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ -n "$(gofmt -l .)" ]; then + echo "Go code is not properly formatted. Use 'gofmt'." + gofmt -d . + exit 1 +fi diff --git a/.travis.yml b/.travis.yml index 66dd9f951..a07972949 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,6 +35,7 @@ before_install: fi script: + - . ./.travis.gofmt.sh # Run the unit tests first - | set -e