-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: [modules + integration] go mod discover, discover a set of unpacked modules within a directory #31299
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
Comments
It would help if you could trim down the redundant boilerplate text from each of your posts into a single sentence + link for more details (e.g., a Gist or meta-issue or something). The added verbosity makes it more difficult to quickly identify the unique details of each individual issue. Thanks. |
What does it mean for a Go module to be "valid" here? E.g., you suggest go.mod files within testdata and/or vendor subdirectories are not valid. Why is that the case? |
Done. Thanks for the comment. Do ping me if you find more things to improve. |
Short term, probably just that the module descriptor is parse-able by Go without errors. Long term, whatever sanity rules the language wants to impose on its modules.
For For Either way ignoring |
Today you can check this by running |
@mdempsky you forgot the find part, then the tesdata/vendor magic rules, add them to the mix and you'll find out it's not so simple |
There's nothing Go-specific about that, but okay:
You defined "valid" as "just that the module description is parse-able by Go without errors," and I identified a command to distinguish that. But it sounds now like you want something more nuanced than that. It would help if you would clearly and concisely state precisely what you're asking for. Alternatively, identify some sample Go code repositories and the go.mod files within that should or should not be considered "valid". |
@mdempsky I defined the discovery feature in the first message, you are trying to do bits of it separately, the result is still bits of it. The more nuanced part is just applying all the Go source code rules. There are already quite a lot of them on vendor and testdata. There will be probably more in the future. Will you maintain your shell snippet when the language adds more rules, when it is already taking more than a line? Your snippet is also not outputting the modules names corresponding to the mod files. That's another thing which that can not be deduced trivially from the |
doesn't look like there's anything to do here. |
This report is part of a series, filled at the request of @mdempsky, focused at making Go modules integrator-friendly.
Please do not close or mark it as duplicate before making sure you’ve read and understood the general context. A lot of work went into identifying problems points precisely.
Needed feature
Go needs an official
go mod discover
command that processes a directory of unpacked Go code and identifies the valid Go modules within this directory.Constrains
info
files next to the correspondingmod
files, or notMotivation
go.mod
files in other places than the root of the projecttestdata
orvendor
mean somego.mod
files are not considered as module descriptor but just data, so a basicfind
won’t workAll of this make module discovery a lot of work that should be handled by common tooling.
The text was updated successfully, but these errors were encountered: