Add script to check 'go fmt' status

This commit is contained in:
Philip O Toole
2016-03-14 21:51:27 -07:00
parent 5bc007f40b
commit 333caaae75

6
gofmt.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
fmtcount=`git ls-files | grep '.go$' | xargs gofmt -l 2>&1 | wc -l`
if [ $fmtcount -gt 0 ]; then
echo "run 'go fmt ./...' to format your source code."
exit 1
fi