-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: 'go list -m all' and 'go list -m ...' started to produce different results on tip #35728
Comments
Change https://golang.org/cl/208258 mentions this issue: |
The distinction between the two is intentional. Per https://golang.org/cmd/go/#hdr-Package_lists_and_patterns:
In contrast, |
Hmm, reading this more closely, I see that you're talking about module patterns rather than package patterns. The package pattern |
Yes, I am talking about listing modules specifically (the Relevant documentation
(Source: https://golang.org/cmd/go/#hdr-List_packages_or_modules.) Would you mind elaborating on why I'm noticing that doing
I'm asking because I'd like to understand this better. Thank you. |
The main issue for this is #32027. To summarize, a command run in module mode outside a module completes slowly when it needs to resolve a package path to a module, since it needs to find the latest version of that module. The command also isn't reproducible, since it may find a different version of the module every time. It's not a good user experience, especially for new users trying out modules by setting A few different remedies were proposed in #32027. The one we went with was simply to make it an error to resolve an import path to a module. It's still possible to list or build packages in |
If I'm in module mode and I'm about to |
Change https://golang.org/cl/208222 mentions this issue: |
When the GOMOD value is the operating system's null device, there isn't a main module. Return an empty build list right away, since running 'go list -m all' in Go 1.14 will cause a "cannot match "all": working directory is not part of a module" error. Fixes golang/go#35690 Updates golang/go#35728 Change-Id: I024ca3b7d774835140ce4a1625133aff6554a533 Reviewed-on: https://go-review.googlesource.com/c/tools/+/208258 Reviewed-by: Bryan C. Mills <bcmills@google.com>
With Go 1.13, both
go list -m all
andgo list -m ...
return the same results when executed outside of a module (i.e., whengo env GOMOD
reportsos.DevNull
):On tip, they produce different results:
Is this intentional new behavior?
/cc @bcmills @jayconrod
The text was updated successfully, but these errors were encountered: