cmd/go: `go get` has no way to get test dependencies #5126

mitchellh opened this Issue Mar 25, 2013 · 4 comments


None yet
5 participants
What steps will reproduce the problem?

1. Create a test in your package that imports any package that you don't have downloaded
2. `go get`
3. `go test` - Fails due to import not found. 

What is the expected output?

`go get` will get the test dependencies as well, or at least have a flag to.

What do you see instead?

`go get` doesn't get any test dependencies, so the tests fail.

Which compiler are you using (5g, 6g, 8g, gccgo)?


Which operating system are you using?

Mac OS X 10.8.3

Which version are you using?  (run 'go version')


Please provide any additional information below.

There is a workaround to this, using `go list`. You can build something like this:

However, I feel that this is less than ideal and is counter-intuitive to the rest of the
way that Go works. I think there should be a flag on `go get` that gets test

rsc commented Jul 30, 2013

Comment 2:

Labels changed: added priority-later, go1.2maybe, feature, removed priority-triage.


robpike commented Aug 4, 2013

Comment 3:

Labels changed: added toolchange.

Status changed to Accepted.


adg commented Aug 11, 2013

Comment 4:

Owner changed to @adg.

Status changed to Started.


adg commented Aug 14, 2013

Comment 5:

This issue was closed by revision 5dde7cc.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015

@rsc rsc removed the go1.2maybe label Apr 14, 2015

@gopherbot gopherbot locked and limited conversation to collaborators Jun 24, 2016

This issue was closed.

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