x/tools/go/loader: fails to load packages that contain XTest files that use vendored imports #17556
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Tools
This label describes issues relating to any tools in the x/tools repository.
Milestone
What version of Go are you using (
go version
)?go version go1.7.1 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
What did you do?
vendor
directory (mkdir -p foo/vendor/test.com
)echo 'package bar' > foo/vendor/test.com/bar.go
)echo 'package foo_test; import _ "test.com/bar"' > foo/foo_test.go
loadcfg.ImportWithTests("./foo")
to specify the package should be importedloadcfg.Load()
to load the packagesFull Go test that reproduces the issue:
What did you expect to see?
The
loadcfg.Load()
call should succeed without errorsWhat did you see instead?
The
loadcfg.Load()
call returns the following error:Notes from investigation
echo 'package foo; import _ "test.com/bar"' > foo/foo.go
, then this works*_test
) -- if step 3 in the repro steps is replaced withecho 'package foo; import _ "test.com/bar"' > foo/foo_test.go
, then this worksSeems to be an issue with how the vendor directory is processed, but the behavior of XTest files should match the behavior of non-test and same-package test files (especially since the built-in Go commands like
go build
andgo test
handle this correctly).The text was updated successfully, but these errors were encountered: