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 to golang.org/x/tools. I only want to maintain the golang.org/x/tools/imports package.
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/importsso 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/importspackage.