That's a totally reasonable thing to do, and in fact co-developing two modules the way you are describing is probably one of the best use cases for `replace` directives. Though, keep in mind that replace directives won't actually be honored by any packages which depend on yours (in this example github.com/clementauger/dplay), so it would be a good idea to try to eventually upstream whatever changes you've made to the source repository at github.com/anacrolix/dht and then remove the `replace` directive.
On Saturday, May 1, 2021 at 7:16:40 AM UTC-7 clement...@gmail.com wrote: > Hello, > > While toying in some projects i ended using go mod replace directive to > point to a local directory containing a git clone of a remote, that i know > will need some modifications. > > something like > $ git clone github.com/anacrolix/dht dht > $ cat go.mod > > module github.com/clementauger/dplay > > go 1.16 > > replace github.com/anacrolix/dht => ./dht > > require ( > github.com/anacrolix/dht v1.0.1 // indirect > github.com/anacrolix/dht/v2 v2.9.0 // indirect > ) > > is it intended or am i over using it ? > > Do you recommend to commit the remote into my repository to keep my dirty > fork along the rest of the code and keep things straight forward to re > compile ? > > Do you think it is a good idea to map the local fork to a remote branch as > part of a larger model to drive code management ? > > i would prefer to get that right upfront, i know the pain i will have to > handle mass import path update, it is so terribly boring (and gomod has > made it easy so far!). > > I might have missed it but i can not find much about these in > https://blog.golang.org/using-go-modules > > I also gave a try to https://www.google.com/search?q=go+mod+best+practices > It is not very helpful. > > thanks for interest and suggestions. > -- 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/f0a7f605-1c1f-451d-8b50-f143fea0de4cn%40googlegroups.com.