Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: cmd/go: allow replacing a subdirectory within a package #30886
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
Right now, I have to replace the entire module with my fork. I only modified
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?