cmd/go: option to initialize go mod from git submodules #47824
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
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
Furthermore, when I try to explicitly copy the exact same git refs for the dependency versions, then
If someone can help me to reliably migrate the exact same dependency tree to go mod, then I would be grateful.
The text was updated successfully, but these errors were encountered:
Could you say more about how you're using submodules? Concepts in Go modules and Git submodules don't map directly to each other, so it's not clear to me how this would work or whether it would be feasible.
It sounds like you have submodules checked out into the vendor directory, presumably at locations that correspond to repository root paths. If that's the case, then
It's probably feasible for
We're probably not going to be able to get to this soon; I don't think many people are in this situation. In the mean time, you can simulate the result by using