Created
June 4, 2014 01:02
-
-
Save cubicdaiya/770064e4d928640d9ca1 to your computer and use it in GitHub Desktop.
checking go fmt by git-hook
This file contains 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
#!/bin/bash | |
echo "go fmt ./..." $'\n' | |
result=`go fmt ./...` | |
if [ "$result" != "" ]; | |
then | |
msg="You forgot to execute 'go fmt' to the following files" | |
if [ `uname` = "Darwin" ]; then | |
echo $'\e[31m'$msg$'\e[m' $'\n' | |
elif [ `uname` = "Linux" ]; then | |
echo -e "\e[1;31m$msg\e[m" $'\n' | |
fi | |
echo $result $'\n' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment