diff --git a/.travis.gofmt.sh b/.travis.gofmt.sh new file mode 100755 index 0000000..df102ac --- /dev/null +++ b/.travis.gofmt.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +result="$(gofmt -s -l .)" +if [ -n "$result" ]; then + echo "Go code is not formatted, run 'gofmt -s -w .'" >&2 + echo "$result" + exit 1 +fi diff --git a/.travis.yml b/.travis.yml index c6ba388..2b622a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,5 @@ install: - go get golang.org/x/tools/cmd/cover script: - ./.test-coverage travis-ci + - ./.travis.gofmt.sh - go install github.com/FreifunkBremen/yanic