Navigation Menu

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

x/tools/go/packages: include dependencies of tests in go list fallback #26753

Closed
suzmue opened this issue Aug 1, 2018 · 1 comment
Closed

Comments

@suzmue
Copy link
Contributor

suzmue commented Aug 1, 2018

What version of Go are you using (go version)?

Go 1.10.3

Does this issue reproduce with the latest release?

No

What did you do?

Tried to load imports of a test package

a_test.go:

package a

import ( 
   "testing"
   "github.com/other/package"
)

Try to load packages with tests:

cfg := &packages.Config {
   Mode: packages.LoadImports,
   Tests: true,
}

pkgs, err := packages.Load(cfg, "a") 

What did you expect to see?

I expected imports of the package that included "a_test.go" to include "testing" and "github.com/other/pkg".

What did you see instead?

The test package does not have "testing" or "github.com/other/pkg" in Imports.

The fallback implementation does not load the dependencies of tests or xtests.

@gopherbot gopherbot added this to the Unreleased milestone Aug 1, 2018
@gopherbot
Copy link

Change https://golang.org/cl/127457 mentions this issue: go/packages: include test deps in golist fallback

@golang golang locked and limited conversation to collaborators Aug 2, 2019
@rsc rsc unassigned suzmue and matloob Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants