One of your dependencies could, in turn, have a dependency on that third
party project. Run "go mod graph" to see what imports what and you should
be able to track it down.

As for the replace directive, I've always viewed it as a temporary quick
fix. In your own code, you can simply replace the module import with a
search and replace, but the harder part is in third party dependencies
where you don't own the code. You might want to contact those projects and
file Issues or send PR's due to their depending on a dead library.

On Tue, Jun 18, 2024 at 1:47 AM Stephen Illingworth <
stephen.illingwo...@gmail.com> wrote:

> Hello,
>
> What's the correct way to do the following:
>
> I'm using a third-party Go module which is no longer under development.
> I've forked the project in order to apply some patches of my own.
>
> I want to use the new version of the module in my project. The following
> has been added to the go.mod file (not the real URLs)
>
> replace github.com/thirdparty/project/v4 v4.7.0 =>
> github.com/me/project/v4 v4.7.2
>
> Is this a good long-term solution or should I rename all imports so they
> point to the fork and do away with the replace directive?
>
>
> Assuming I'm using the replace directive for now, when I do this now after
> cleaning the mod cache:
>
> go get github.com/thirdparty/project/v4
>
> The output is this, which is surprising:
>
> go: downloading github.com/me/project/v4 v4.7.2
> go: downloading github.com/thirdparty/project v1.12.0
>
> It seems to be pulling the latest release of v1 of the original project.
> Why is it doing this?
>
>
>
> Regards
> Stephen
>
> --
> 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/ac7067f6-d69a-4daf-b09f-3ad2c8ed6569n%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/ac7067f6-d69a-4daf-b09f-3ad2c8ed6569n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CA%2Bv29LtukNRH%2BL98gvpafbfngZ%3Dcb%3DLL2PQPuPBWESw0wsBAhg%40mail.gmail.com.

Reply via email to