When I run go mod tidy
, it breaks because a package imported by my project imports another package using path github.com/coreos/bbolt
, but when it fetches the package from this path its go.mod
says its path is go.etcd.io/bbolt
.
The problem is that both the importing package and the imported package are 3rd party packages. I know I could edit the go module cache to fix it, but it would be a real hell fixing it when new versions of these packages become available.
Partial echoed messages are shown below:
github.com/coreos/etcd/client tested by
github.com/coreos/etcd/client.test imports
github.com/coreos/etcd/integration imports
github.com/coreos/etcd/etcdserver imports
github.com/coreos/etcd/mvcc/backend imports
github.com/coreos/bbolt: github.com/coreos/[email protected]: parsing go.mod:
module declares its path as: go.etcd.io/bbolt
but was required as: github.com/coreos/bbolt
So, how can I fix or work around this situation?
go
command — and one that I'm likely to fix as part of golang.org/issue/26904, which will address this sort of “renamed module” use-case more directly. 😅 – Burlington