Skip to content
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: 'go list' fails to populate Module field for test packages #39974

Open
bcmills opened this issue Jul 1, 2020 · 1 comment
Open

cmd/go: 'go list' fails to populate Module field for test packages #39974

bcmills opened this issue Jul 1, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented Jul 1, 2020

example.com$ go version
go version devel +84152d57 Wed Jul 1 09:07:18 2020 +0000 linux/amd64

example.com$ go list -test -f '{{.ImportPath}} {{.Module}} {{.ForTest}}' .
example.com example.com
example.com.test <nil>
example.com [example.com.test] example.com example.com

-- a.go --
package a
-- a_test.go --
package a

import "testing"
-- go.mod --
module example.com

go 1.15

Note the <nil> entry in the Module field for the synthesized example.com.test package.

CC @jayconrod @matloob

@bcmills bcmills added this to the Go1.16 milestone Jul 1, 2020
@bcmills bcmills self-assigned this Jul 1, 2020
@gopherbot
Copy link

@gopherbot gopherbot commented Jul 1, 2020

Change https://golang.org/cl/240678 mentions this issue: cmd/go: populate the Module field for test packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.