-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from SimonBaeumer/add-githook
Add githook
- Loading branch information
Showing
3 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "Run gofmt..." | ||
FMT_FILES=`gofmt -l . | grep -v "vendor/"` | ||
if [[ $FMT_FILES != "" ]]; then | ||
echo "Some files aren't formatted, please run 'go fmt ./...' to format your source code before committing" | ||
echo "${FMT_FILES}" | ||
exit 1 | ||
fi | ||
|
||
echo "Run go vet..." | ||
vetcount=`go vet ./... 2>&1 | wc -l` | ||
if [ $vetcount -gt 0 ]; then | ||
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" | ||
exit 1 | ||
fi |
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
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