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: foo.test package lacks Imports in list -deps -json output #25949

Closed
alandonovan opened this issue Jun 18, 2018 · 4 comments
Closed

cmd/go: foo.test package lacks Imports in list -deps -json output #25949

alandonovan opened this issue Jun 18, 2018 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@alandonovan
Copy link
Contributor

$ vgo list -deps -json -test strings 
...
{
        "Dir": "/usr/local/google/home/adonovan/goroot/src/strings",
        "ImportPath": "strings.test",
        "GoFiles": [
                "/usr/local/google/home/adonovan/.cache/go-build/f1/f18b79e640ed6afff6ac5e0e01a74b8b7a2fedf753712d3ec070aa43dde391e0-d"
        ],
        "Deps": [
                "bufio",
                ...
        ]
}
$ cat /usr/local/google/home/adonovan/.cache/go-build/f1/f18b79e640ed6afff6ac5e0e01a74b8b7a2fedf753712d3ec070aa43dde391e0-d
...
import (
        "os"
        "testing"
        "testing/internal/testdeps"
        _ "strings"
        _xtest "strings_test"
)
...

The JSON blob for the strings.test executable, which consists of a single generated testmain file that resides in the cache, doesn't have an Imports section even though the file has five imports.

golang.org/x/vgo@7fbc8df
go@b7d9e6e

@gopherbot gopherbot added this to the vgo milestone Jun 18, 2018
@bcmills
Copy link
Contributor

bcmills commented Jun 20, 2018

Does go list (in the golang/go repo) exhibit the same problem?

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jun 20, 2018
@alandonovan
Copy link
Contributor Author

Yes, it does (go version devel +b7d9e6e149).

@bcmills bcmills changed the title x/vgo: foo.test package lacks Imports in JSON output cmd/go: foo.test package lacks Imports in list -deps -json output Jun 20, 2018
@bcmills bcmills modified the milestones: vgo, Go1.11 Jun 20, 2018
@matloob matloob self-assigned this Jun 29, 2018
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/121656 mentions this issue: cmd/go/internal/load: surface testmain imports in go list output

@gopherbot
Copy link
Contributor

Change https://golang.org/cl/122878 mentions this issue: cmd/go: add ImportMap to go list package struct

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants