Check gofmt in travis tests

This commit is contained in:
Julian Kornberger 2018-01-13 16:46:37 +01:00
parent d2e37f8c7d
commit 37e798cd22
2 changed files with 9 additions and 0 deletions

8
.travis.gofmt.sh Executable file
View File

@ -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

View File

@ -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