forked from Harkishen-Singh/Jarvis-personal-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce gofmt in TravisCI (Harkishen-Singh#164)
Add a script run at build time that checks Go formatting and fails if it needs formatting.
- Loading branch information
1 parent
bf9e68d
commit 239760a
Showing
3 changed files
with
13 additions
and
4 deletions.
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
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,9 @@ | ||
#!/bin/bash | ||
|
||
echo 'running go fmt on all packages...' | ||
invalidFiles=$(gofmt -l . 2>&1) | ||
if [ "$invalidFiles" ]; then | ||
echo "These files did not pass the 'go fmt' check, please run 'go fmt' on them:" | ||
echo $invalidFiles | ||
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