-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: ambiguous import path not detected when the colliding path is in the standard library #35270
Comments
This has ~nothing to do with specifying module paths: it would be conceptually ok (if somewhat fragile) to create a The problem here is that the existing CC @jayconrod |
See also #26227. |
@bcmills Is this likely to happen for 1.18? Thanks. |
I'm not sure. It should be a fairly easy fix, but it doesn't need to hold up the release; moving to 1.19 for now, but I may move it back if the fix turns out to be small enough to go in during the freeze. |
Change https://go.dev/cl/434095 mentions this issue: |
…n std Fixes golang#35270 Change-Id: I5d2a04359702be6dc04affb867540091b926bc23 Reviewed-on: https://go-review.googlesource.com/c/go/+/434095 Run-TryBot: xie cui <[email protected]> Auto-Submit: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]> Reviewed-by: Bryan Mills <[email protected]>
@bcmills wanted to flag that the code that merged to fix this issue (https://go.dev/cl/434095) introduced what I believe are regressions in behavior for vendor mode in Go 1.20: #58417: cmd/go: "list -json" prints non-JSON output if vendor directory is present (Go 1.20 regression) I'm going to investigate further to try to understand what's going on, but as this issue doesn't mention vendoring, it seems likely that the change in behavior was an unintentional side effect of the fix for this issue. It seems to me that, in the workflows I posted in my issue, the behavior before this change was merged was more correct, but if you could provide any clarity around that it would be much appreciated (I have tooling and workflows that depended on the previous behavior and it would be helpful to know if the new behavior is a bug where I can wait for a fix, or if the updated information/behavior is intentional and I need to figure out a different workaround). |
Suggest in Go 1.14 we go one step further when
GO111MODULE="on"
, outside and inside!GOPATH
, module path must be specified to prevent shenanigans.When trying to create a module
crypto
outside gopath you getPerfect, but if you do that inside gopath
Not only is it allowed, you even launch the wrong test files from
GOROOT
I understand this is done for backward compatible sake, but GOPATH must die and end up somewhere as a dot folder hidden only used for cach.
Furthermore I suggest to change error message
to
to stop promoting people to use GOPATH
(related to: #35070)
The text was updated successfully, but these errors were encountered: