-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: go test cannot find module path in module root directory #26722
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
Comments
I can reproduce this on tip. |
cc @bcmills |
I suspect that this is the same underlying problem as #26602. |
@suzmue I can repro as well. I did notice
Maybe the same is true for |
I bisected - it seems that https://go-review.googlesource.com/125836 (commit b294fe9) introduced this problem. |
@rogpeppe, thanks for bisecting. In my experience debugging similar issues this week, these kinds of problems are very sensitive to the state of the module cache: did you clear the module and build caches at each commit? (Just wondering how confident I should be in the bisection result.) |
@bcmills I just tried again with clean module and build caches and I got the same results. I might be missing something though. |
Nope, you've probably got it right. I suspect an off-by-one error (a trailing slash). |
That is: 68170aa succeeds consistently; FWIW I've been using gopkg.in/macaroon.v2 for testing.
After downloading the deps, I get:
|
I added @suzmue's repro steps as a script test and it fails. (Thanks for the great minimal test case!) I'll try macaroon too once it's fixed, just to be sure. |
Think I've found the problem. The |
Change https://golang.org/cl/127795 mentions this issue: |
Hmm,
|
Change https://golang.org/cl/127796 mentions this issue: |
Ok, think I've got it this time.
|
Adding my findings to this issue... here's an example project that uses
|
I'm seeing this too, github.com/anacrolix/dht. $ GO111MODULE=on go test . |
Should be fixed at head. Please let me know if you're still seeing these symptoms. |
Yes that's fixed it. |
Any idea when this will be pushed to vgo? |
What version of Go are you using (
go version
)?go version devel +ecec63c8a1 Tue Jul 31 16:34:38 2018 +0000 darwin/amd64
Does this issue reproduce with the latest release?
testing with tip (issue does not reproduce in go1.11beta2)
What operating system and processor architecture are you using (
go env
)?What did you do?
Files in directory a:
a/a.go:
package a
a/a_test.go:
package a; import "testing"; func Test(t *testing.T){}
a/go.mod:
module github.com/user/a
What did you expect to see?
What did you see instead?
Additional notes
go test
works as expected in any subdirectories of a.The text was updated successfully, but these errors were encountered: