-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: don't add dependencies of external tests #32380
Comments
Please see this comment from @rsc
So the test dependency will show up in go.mod. But it doesn't get downloaded until you run |
There's also other existing issues, like #26955. This should probably be closed as a duplicate. |
I get that the tests are included in go.mod |
If you run |
after cleaning up all packages form /src and /pkg/mod I cant run go test at all unless I manually go get a certain package. output of go mod why -m github.com/Netflix/go-expect:
|
GitHub search turned it up pretty readily: Edit: never mind, I think I misinterpreted. |
Depending on which version of |
I know where it is imported, but I cant find that test in |
Ahhh! I get it now. What was the exact command that you ran to produce that output, and in what working directory? I don't see any paths from |
Oh I dint actually notice, I ran it from the GOPATH but
This is because After removing this dependency I can run |
The issue with
(On the other hand, |
Sounds like the open questions are all resolved though; closing. (Please do file an issue if you run into any more trouble.) |
Change https://golang.org/cl/220080 mentions this issue: |
Updates golang/go#36460 Updates golang/go#27900 Updates golang/go#26955 Updates golang/go#30831 Updates golang/go#32058 Updates golang/go#32380 Updates golang/go#32419 Updates golang/go#33370 Updates golang/go#33669 Updates golang/go#36369 Change-Id: I1d4644e3e8b4e688c2fc5a569312495e5072b7d7 Reviewed-on: https://go-review.googlesource.com/c/proposal/+/220080 Reviewed-by: Russ Cox <rsc@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
presumably
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
go mod tidy
What did you expect to see?
a go.mod that doesnt include dependencies of tests in external packages
What did you see instead?
github.com/Netflix/go-expect v0.0.0-20180928190340-9d1f4485533b // indirect
got added because it is a dependency of some tests in gopkg.in/AlecAivazis/survey.v1
If a test is part of the current module(or submodule thereof) it should be included in the dependencies, but external tests will not be run on building on any platform with any build tag.
The text was updated successfully, but these errors were encountered: