Skip to content

Instantly share code, notes, and snippets.

@micvbang
Created October 22, 2018 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micvbang/4c8cb1f24cfe04d1a0dfab010eb851d8 to your computer and use it in GitHub Desktop.
Save micvbang/4c8cb1f24cfe04d1a0dfab010eb851d8 to your computer and use it in GitHub Desktop.
#!/bin/bash
BUILD_OUTPUT=$(go build ./... 2>&1)
retVal=$?
if [ $retVal -ne 0 ]; then
echo "$BUILD_OUTPUT"
echo -e "\nErrors during compilation. Please fix before committing."
exit 1
fi
TEST_OUTPUT=$(go test ./... 2>&1)
retVal=$?
if [ $retVal -ne 0 ]; then
echo "$TEST_OUTPUT"
echo -e "\nErrors during testing. Please fix before committing."
exit 1
fi
@micvbang
Copy link
Author

Change the extension (only used for syntax highlighting)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment