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

Comments

Projects
None yet
4 participants
@alandonovan
Copy link
Contributor

commented Jun 18, 2018

$ 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

This comment has been minimized.

Copy link
Member

commented Jun 20, 2018

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

@alandonovan

This comment has been minimized.

Copy link
Contributor Author

commented Jun 20, 2018

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

This comment has been minimized.

Copy link

commented Jun 29, 2018

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

@gopherbot

This comment has been minimized.

Copy link

commented Jul 10, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.