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

go/internal/gcimporter: support vendoring #13756

Closed
alandonovan opened this issue Dec 28, 2015 · 3 comments
Closed

go/internal/gcimporter: support vendoring #13756

alandonovan opened this issue Dec 28, 2015 · 3 comments

Comments

@alandonovan
Copy link
Contributor

The Go 1.5. vendoring feature means that a package importer is now logically a function of two variables: the import path, and additionally the directory in which the import declaration appears.

The go/types TestStdlib test currently fails because the default importer does not support vendoring (and cannot without an API change).

@griesemer griesemer added this to the Go1.6Maybe milestone Jan 4, 2016
@griesemer
Copy link
Contributor

Duplicate of #13688.

@rsc
Copy link
Contributor

rsc commented Jan 6, 2016

@alandonovan, if I invert the flag, this gets fixed automatically, right?

@alandonovan
Copy link
Contributor Author

No. The problem here is that vendoring makes the interpretation of an import path a function of two parameters, and the go/types.Importer interface exposes only one. Ideally, we would add a srcDir string parameter to the interface's method, and its implementations would plumb this value through to (*build.Context).Import. That, of course, would be an incompatible API change, though I suspect there are few if any clients that define their own Importer types.

(It's possible that flipping the flag causes the tests to pass, but it wouldn't solve the general problem.)

@golang golang locked and limited conversation to collaborators Jan 7, 2017
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

4 participants