From eddda577a4dd7f8fb4fb67fd1600c2a7c5de40c7 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Mon, 16 Dec 2013 22:54:06 -0700 Subject: [PATCH] Fix "go tool cover" detection to only add -cover and -coverprofile if we both have cover support in Go, and if we have the cover tool downloaded --- hack/make.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hack/make.sh b/hack/make.sh index 91f641af89..c49a37e9a2 100755 --- a/hack/make.sh +++ b/hack/make.sh @@ -66,7 +66,10 @@ LDFLAGS_STATIC='-X github.com/dotcloud/docker/utils.IAMSTATIC true -linkmode ext BUILDFLAGS='-tags netgo' HAVE_GO_TEST_COVER= -if go help testflag | grep -q -- -cover; then +if \ + go help testflag | grep -q -- -cover \ + && go tool -n cover > /dev/null 2>&1 \ +; then HAVE_GO_TEST_COVER=1 fi