[Solved] Local modules and `go get -u`

Say that I have to use a local module “github.com/kerokero/utils”. It’s not published, it doesn’t exist at github.com, the name is just to satisfy go (at some point in v1.12 go mod tidy forced me to move from “kerokero/utils” to “github.com/kerokero/utils”). So I use it like this:

require github.com/kerokero/utils v0.0.0

replace github.com/kerokero/utils => ../utils

And it works, it builds. But when I run go get -u to update the other dependencies, it tries to download that one too, from github.com. I can’t understand why. Shouldn’t it see that it is a local module and shouldn’t be touched?

1 Like

Apparently it’s a known issue: https://github.com/golang/go/issues/32567

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.