-
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: resolve local paths to modules in subdirectory replacements #43733
Comments
Change https://golang.org/cl/335269 mentions this issue: |
Is this proposal to cover only the case where the module in the subdirectory is mentioned in the main module? Or is it going to allow to run |
No, that shouldn't work, though an error message probably ought to say why. After this is fixed, |
On a recent tip,
Errors seem correct as the
The included directory is seen as a package. No change in results when go.mod is set to 1.16 or 1.17. |
This is in the Go1.18 milestone. Is it likely to happen for 1.18? Thanks. |
@bcmills This is in the 1.18 milestone; time to move to 1.19? Thanks. |
As of Go 1.18 this is also relevant to paths that could refer to packages in other modules in the same workspace. The interaction between this and |
Using The warning below should be considered as correct as the sub-directory is a module (go.mod is present) and a not a package.
When expecting all of them:
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run
go list
or any other module-aware command on an absolute or relative path (starting with./
) that points to a subdirectory inside a separate module which provides a replacement.What did you expect to see?
go list
should succeed and print the package path. In the example above, it should printexample.com/m/sub
.What did you see instead?
go list
fails with:It looks like the
go
command resolves the path argument to a directory within the module before checking whether it might be part of a replacement module in another directory.Other notes
This issue is related to the thread
go list
across multiple modules on golang-nuts.The text was updated successfully, but these errors were encountered: