cmd/go: option to initialize go mod from git submodules #47824
Labels
FeatureRequest
GoCommand
cmd/go
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Hi,
I have historically used git submodules as the most reliable way to manage library dependencies in my Go projects. I would very much like to migrate to modern Go modules. However, the
go mod init
system does not appear to support generating go.mod configurations from git submodules.When I try to do this, I either get NO modules in the resulting go.mod file, or else I get the latest versions of everything, which of course breaks my application. Please include automation for migrating
vendor/
directories from git submodules to go.mod.Furthermore, when I try to explicitly copy the exact same git refs for the dependency versions, then
go mod
operations corrupt these.go mod
checks out a completely different version of the dependency tree than I have in the originalvendor/
with git submodules.If someone can help me to reliably migrate the exact same dependency tree to go mod, then I would be grateful.
Example:
https://github.com/mcandre/octane/tree/61e9374d9695f2b3f1489741396f4f3082f3fd74
The text was updated successfully, but these errors were encountered: