-
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: behavior of go list ... is not documented in module mode #37227
Comments
Unrelated to this issue, I also noted that with
This seems to contrast with the documentation saying The result is the same with |
/cc @jayconrod @bcmills @matloob per owners. |
I think that The difference between |
It is true that we have not documented the The increase from Go 1.11 to 1.12 is due to the change from The increase from Go 1.12 to 1.13 is due to the inclusion of the The minor changes from Go 1.13 to 1.14 are due to changes in |
The difference between GOPATH mode and module mode in Go 1.13 is due to the requirement that each package have a unique path in module mode: for example, the package reported as Arguably the lack of such a listing entirely in GOPATH mode is a bug, but it is a fairly minor one and at this point almost certainly not worth fixing. |
There is still something missing, in module mode. For Inside the
Am I missing something? |
Per https://tip.golang.org/cmd/go/#hdr-Package_lists_and_patterns:
Since no package in the main module can import a |
Is it only me that thinks this is really complex? |
The |
It could be make useful if |
@perillo can you not do
|
I think we do need a pattern that matches only the packages in the main module, but ( |
@myitcv: |
@jayconrod, @matloob, and I were discussing such a pattern this morning, in fact. (We're thinking maybe But that really ought to be filed as a separate issue. |
@bcmills I tested |
It would if I think |
Ok, one last try 😄
|
My suggestion is to update the documentation to say a pattern containing a |
go help packages
documents the special pathall
both for gopath and module mode:However the
...
pattern is documented only for gopath module:How is the
...
pattern supposed to work in module mode?As a test, I ran
go list ... | wc -l
inside thegithub.aaakk.us.kg/golang/mod
(golang.org/x/mod
) directory with different versions of the go tool. The directory is outside GOPATH. The results are:go1.11.13
: 501go1.12.16
: 526go1.13.8
: 632go1.14rc1
: 634As a side note, how can I tell
go list
to list only packages in the main module?The text was updated successfully, but these errors were encountered: