proposal: cmd/go: allow replacing a subdirectory within a package #30886
Comments
I'm not sure that's the right approach here, since the /cc @bcmills |
The term “module” as applied to software development is a self-contained unit of code. We specify module requirements at the granularity of individual modules, so it's not at all obvious to me how a replacement for only part of a module would interact with requirement resolution. As a proposal, this would need a lot more detail, and even then I think it's unlikely that the marginal value would outweigh the increase in complexity (both for users and in the implementation). For this concrete case, #20818 is still marked as Proposal-Approved. Is there a reason you cannot contribute your fixes upstream? |
Sounds fine to me.
No, just wanted to use it immediately without changing all import paths. |
Right now, the replace directive only allows replacing modules with different modules.
It'd be nice if you could just replace a single sub package within a module with a different package elsewhere in a different module.
My use case is that right now goimports does not support reordering imports when there are multiple groups (#20818) and so I forked
golang.org/x/tools
.Right now, I have to replace the entire module with my fork. I only modified
golang.org/x/tools/imports
so I only want to replace that package with the package from my fork. I don't want to maintain my fork and keep it up to date to use new additions togolang.org/x/tools
. I only want to maintain thegolang.org/x/tools/imports
package.The text was updated successfully, but these errors were encountered: