> On Aug 26, 2021, at 5:21 PM, Paul S. R. Chisholm <
psrch...@gmail.com> wrote:
>
> Hypothetical example: Say I'm writing an application that uses "
rsc.io/quote" and I discover a bug in that package that breaks my software. I would of course clone the quote repository, add a test that demonstrates the bug, fix the bug, and submit a patch to the maintainer.
>
> After making the fix but before submitting the patch, I'd like to first import my local copy of the quote package to ensure my change prevents the problem in my application. How could I do that?
I recently did something like this:
1. Fork the repository
2. Clone it, fix it up
3. Push your changes to your fork
4. Then, in your project:
go mod edit -replace
github.com/upstream_org/repo=github.com/your_user/repo@branch
The thing I don’t like about this approach is having to push to the remote each time I want to iterate.
However, after writing this all out, I recently did a quick experiment to see if I could just operate on a local copy and it seems to have worked!
1. Clone the repository
2. Fix it up locally
3. Then, in your project:
go mod edit -replace GitHub.com/upstream_org/repo=/path/to/your/clone/of/the/patched-project
Connor