Enforce gofmt in travis

Run gofmt -l . during travis to catch pull requests that have not had
gofmt run on them.

Change-Id: Ibfdf988a535d82721f3c4bc328b189f606f12778
This commit is contained in:
Colin Cross 2016-08-11 10:12:46 -07:00
parent a028bf49ba
commit 5b0231b027
2 changed files with 8 additions and 0 deletions

7
.travis.gofmt.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
if [ -n "$(gofmt -l .)" ]; then
echo "Go code is not formatted:"
gofmt -d .
exit 1
fi

View file

@ -15,6 +15,7 @@ before_script:
- source .travis.fix-fork.sh
script:
- ./.travis.gofmt.sh
- go test ./...
- mkdir stage
- cd stage