Created
October 15, 2015 14:11
-
-
Save stevekuznetsov/f3b3e41587ad9428eb41 to your computer and use it in GitHub Desktop.
hack-verify-govet.sh
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 | |
set -o nounset | |
set -o pipefail | |
function exit_func() { | |
echo "exiting from $?" | |
} | |
trap exit_func EXIT | |
GO_VERSION=($(go version)) | |
OS_ROOT=$(dirname "${BASH_SOURCE}")/.. | |
source "${OS_ROOT}/hack/common.sh" | |
source "${OS_ROOT}/hack/util.sh" | |
cd "${OS_ROOT}" | |
mkdir -p _output/govet | |
os::build::setup_env | |
set +x | |
FAILURE=false | |
test_dirs=$(find_files | cut -d '/' -f 1-2 | sort -u) | |
for test_dir in $test_dirs | |
do | |
bash -c "GOPATH=$GOPATH:/root/go/src/github.com/openshift/origin go tool vet -v $test_dir" | |
echo "testing ${test_dir}, got $?" | |
if [ "$?" -ne 0 ] | |
then | |
FAILURE=true | |
fi | |
done | |
# We don't want to exit on the first failure of go vet, so just keep track of | |
# whether a failure occured or not. | |
if $FAILURE | |
then | |
echo "FAILURE: go vet failed!" | |
exit 1 | |
else | |
echo "SUCCESS: go vet succeded!" | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output: