Skip to content

cmd/go: disallow go list ... in module mode #78387

@matloob

Description

@matloob

go list ... in module mode almost never (or maybe just plain never!) does what a user expects it to do. It tries to list all the packages in all the modules in the build list which in turn requires it to resolve dependencies of those modules that might not be required by the build. Further, those dependencies will not be requirements of the work module which will result in a confusing error in the default -mod=mod mode.

We should return an error if a user requests go list ...: it should still be okay to have ... as part of a pattern with other components, because those components limit the search, and the error should say that the pattern has to have another component, and suggest that the user might want ./... or work (which is usually what they want).

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Todo
Status
Accepted

Relationships

None yet

Development

No branches or pull requests

Issue actions