2014-06-23 16:53:50 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2015-01-14 00:34:06 +00:00
|
|
|
fmtcount=`git ls-files | grep '.go$' | xargs gofmt -l 2>&1 | wc -l`
|
|
|
|
if [ $fmtcount -gt 0 ]; then
|
|
|
|
echo "Some files aren't formatted, please run 'go fmt ./...' to format your source code before committing"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2015-02-12 18:17:41 +00:00
|
|
|
vetcount=`go vet ./... 2>&1 | wc -l`
|
2015-01-14 00:34:06 +00:00
|
|
|
if [ $vetcount -gt 0 ]; then
|
2015-01-14 01:03:40 +00:00
|
|
|
echo "Some files aren't passing vet heuristics, please run 'go vet ./...' to see the errors it flags and correct your source code before committing"
|
2014-06-23 16:53:50 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
exit 0
|