]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: download test dependencies of all named packages
authorAndrew Gerrand <adg@golang.org>
Thu, 7 Aug 2014 22:56:40 +0000 (08:56 +1000)
committerAndrew Gerrand <adg@golang.org>
Thu, 7 Aug 2014 22:56:40 +0000 (08:56 +1000)
Fixes #8181.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/123870043

src/cmd/go/get.go
src/cmd/go/test.bash

index e708fcf779fc2591a37ffbe5437b5b0989d97ce9..a34286f540205f80d21bdf593cb95bedadb57e69 100644 (file)
@@ -151,7 +151,9 @@ func download(arg string, stk *importStack, getTestDeps bool) {
        }
 
        // Only process each package once.
-       if downloadCache[arg] {
+       // (Unless we're fetching test dependencies for this package,
+       // in which case we want to process it again.)
+       if downloadCache[arg] && !getTestDeps {
                return
        }
        downloadCache[arg] = true
index e5ba12b1df7834b09769a7ace27a75d4d7f7c9ab..411ef1863f9b3bf5a00699556a05bda745472a00 100755 (executable)
@@ -543,6 +543,17 @@ TEST go get cover
 unset GOPATH
 rm -rf $d
 
+TEST go get -t "code.google.com/p/go-get-issue-8181/{a,b}"
+d=$(TMPDIR=/var/tmp mktemp -d -t testgoXXX)
+export GOPATH=$d
+if ./testgo get -t code.google.com/p/go-get-issue-8181/{a,b}; then
+       ./testgo list ... | grep go.tools/godoc > /dev/null || ok=false
+else
+       ok=false
+fi
+unset GOPATH
+rm -rf $d
+
 TEST shadowing logic
 export GOPATH=$(pwd)/testdata/shadow/root1:$(pwd)/testdata/shadow/root2