Created
May 7, 2012 14:48
-
-
Save flavianmissi/2628184 to your computer and use it in GitHub Desktop.
Git hook to run gofmt -w . before commiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gofmt -w . | |
| if [ "$(git diff --diff-filter M --name-only)" == "$(git diff --cached --name-only)" ]; | |
| then | |
| echo "There's gofmt alterations to be commited." | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment