cmd/go: list the Go resources in a physical directory #30469
Labels
FeatureRequest
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
go 1.11/1.12
A lot of Go projects have been using the historical unpacked filesystem property of GOPATH to mix Go source files with other things (human documentation md files, non-Go resource files, etc).
This mixing does not make sense in module mode, since the Go compiler is the only thing that is smart enough to locate and access the content of module zip files.
Therefore there is a need to inspect existing Go project trees, to separate Go project source files from other things. And you have a bootstrapping problem, because GOPATH is not used in module mode, and the whole point of the inspection is to sort what must end up in the zip files, and what should end up elsewhere, so at this point the project is no longer in GOPATH but not in a zip module yet.
Is there a way to ask Go
"tell me what part of this directory is useful to the builder and should end up in a zip module, and what part needs to be exposed some other way?"
Aside from calling
exec.Command("go", "list", "-f"…, ".")
recursively that is?(Of course one could just zip brutally the whole tree and look what breaks afterwards, but that is not a very efficient way to switch to modules)
The text was updated successfully, but these errors were encountered: