diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh new file mode 100755 index 0000000..bfffdca --- /dev/null +++ b/.travis.gofmt.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +if [ -n "$(gofmt -l .)" ]; then + echo "Go code is not formatted:" + gofmt -d . + exit 1 +fi diff --git a/.travis.yml b/.travis.yml index 02284b5..c64ce51 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,5 @@ go: - tip script: + - ./.travis.gofmt.sh - go test -v ./...