> On Aug 26, 2021, at 5:21 PM, Paul S. R. Chisholm <psrchish...@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

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/E67B8233-D81A-43B5-9FE3-4A2193BE738B%40gmail.com.

Reply via email to