Skip to content

Commit

Permalink
Add script to check 'go fmt' status
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Mar 15, 2016
1 parent 5bc007f commit 333caaa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gofmt.sh
@@ -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

0 comments on commit 333caaa

Please sign in to comment.