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

Closed
mitchellh opened this Issue Mar 25, 2013 · 4 comments

Comments

Projects
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
yet.
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)?

6g

Which operating system are you using?

Mac OS X 10.8.3

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

1.0.3

Please provide any additional information below.

There is a workaround to this, using `go list`. You can build something like this:
https://gist.github.com/mitchellh/9655102de0bc0a849cc2

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
dependencies.
Contributor

rsc commented Jul 30, 2013

Comment 2:

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

Contributor

robpike commented Aug 4, 2013

Comment 3:

Labels changed: added toolchange.

Status changed to Accepted.

Contributor

adg commented Aug 11, 2013

Comment 4:

https://golang.org/cl/12566046

Owner changed to @adg.

Status changed to Started.

Contributor

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.