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/internal/modload: possible to import vendored package not existing in module #60922

Open
matloob opened this issue Jun 21, 2023 · 1 comment
Assignees
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go modules
Milestone

Comments

@matloob
Copy link
Contributor

matloob commented Jun 21, 2023

In cmd/go/internal/modload/import.go in importFromModules:

If someone manually added .go source files to vendor/example.com/foo,
this would result in import "example.com/foo" succeeding but reporting an empty module path for the imported package, which violates all kinds of internal invariants and could perhaps cause a panic somewhere down the line.
@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. GoCommand cmd/go modules labels Jun 21, 2023
@bcmills bcmills added this to the Backlog milestone Jun 21, 2023
@samthanawalla samthanawalla self-assigned this Mar 13, 2024
@gopherbot
Copy link

Change https://go.dev/cl/572200 mentions this issue: cmd/go: import vendored packages only listed in modules.txt

@samthanawalla samthanawalla added FixPending Issues that have a fix which has not yet been reviewed or submitted. and removed NeedsFix The path to resolution is known, but the work has not been done. labels Mar 21, 2024
@samthanawalla samthanawalla modified the milestones: Backlog, Go1.23 Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. GoCommand cmd/go modules
Projects
None yet
Development

No branches or pull requests

4 participants