Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Commit

Permalink
Make no-go-get the default, and don't assume -tags netgo
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwilkie committed Jan 12, 2017
1 parent 8946588 commit 62f6f94
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions test
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
GO_TEST_ARGS=(-tags netgo -cpu 4 -timeout 8m)
SLOW=
NO_GO_GET=
NO_GO_GET=true
TAGS=

usage() {
echo "$0 [-slow] [-in-container foo]"
echo "$0 [-slow] [-in-container foo] [-netgo] [-(no-)go-get]"
}

while [ $# -gt 0 ]; do
Expand All @@ -21,13 +21,23 @@ while [ $# -gt 0 ]; do
NO_GO_GET=true
shift 1
;;
"-go-get")
NO_GO_GET=
shift 1
;;
"-netgo")
TAGS="-tags netgo"
shift 1
;;
*)
usage
exit 2
;;
esac
done

GO_TEST_ARGS=($TAGS -cpu 4 -timeout 8m)

if [ -n "$SLOW" ] || [ -n "$CIRCLECI" ]; then
SLOW=true
fi
Expand Down Expand Up @@ -71,7 +81,7 @@ go test -i "${GO_TEST_ARGS[@]}" "${TESTDIRS[@]}"

for dir in "${TESTDIRS[@]}"; do
if [ -z "$NO_GO_GET" ]; then
go get -t -tags netgo "$dir"
go get -t $TAGS "$dir"
fi

GO_TEST_ARGS_RUN=("${GO_TEST_ARGS[@]}")
Expand Down

0 comments on commit 62f6f94

Please sign in to comment.