Makefile: error out if go files aren't correctly formatted

Noticed in #1058 that our gofmt make target isn't actually erroring
if someone commits misformatted code.
This commit is contained in:
Eric Chiang
2017-09-14 09:44:15 -07:00
parent 38d0de20e3
commit 980400db0b
3 changed files with 11 additions and 4 deletions

7
scripts/gofmt Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash -e
result=$( go fmt $@ )
if [[ $result != "" ]]; then
>&2 echo "The following files are not formatted correctly: $result"
exit 1
fi