[opentelemetry]: missing package when running go mod tidy
jeffreydwalter opened this issue · 3 comments
With v10, I installed go-pg and am getting this error when running go mod tidy
:
go mod tidy -v
go: finding module for package go.opentelemetry.io/otel/label
go.opentelemetry.io/otel/label: module go.opentelemetry.io/otel@latest found (v0.19.0), but does not contain package go.opentelemetry.io/otel/label
I ran across this issue: redis/go-redis#1715 and tried the suggested replace (with versions 15 through 19) in go.mod, but the error persists.
Expected Behavior
I expect to not have this error.
Context (Environment)
go version
go version go1.16.2 darwin/amd64
relevant entries in go.mod
:
github.com/go-pg/pg/v10 v10.9.0 // indirect
relevant entries in go.sum
:
github.com/go-pg/pg/v10 v10.9.0 h1:mNIxE7H7/5fHOniVrLgUXNoIgHiJXXvhiNY+PxqtV6k=
github.com/go-pg/pg/v10 v10.9.0/go.mod h1:rgmTPgHgl5EN2CNKKoMwC7QT62t8BqsdpEkUQuiZMQs=
go.opentelemetry.io/otel v0.17.0 h1:6MKOu8WY4hmfpQ4oQn34u6rYhnf2sWf1LXYO/UFm71U=
go.opentelemetry.io/otel v0.17.0/go.mod h1:Oqtdxmf7UtEvL037ohlgnaYa1h7GtMh0NcSd9eqkC9s=
go.opentelemetry.io/otel v0.19.0 h1:Lenfy7QHRXPZVsw/12CWpxX6d/JkrX8wrx2vO8G80Ng=
go.opentelemetry.io/otel v0.19.0/go.mod h1:j9bF567N9EfomkSidSfmMwIwIBuP37AMAIzVW85OxSg= go.opentelemetry.io/otel/metric v0.17.0/go.mod h1:hUz9lH1rNXyEwWAhIWCMFWKhYtpASgSnObJFnU26dJ0=
go.opentelemetry.io/otel/metric v0.19.0 h1:dtZ1Ju44gkJkYvo+3qGqVXmf88tc+a42edOywypengg=
go.opentelemetry.io/otel/metric v0.19.0/go.mod h1:8f9fglJPRnXuskQmKpnad31lcLJ2VmNNqIsx/uIwBSc=
go.opentelemetry.io/otel/oteltest v0.17.0/go.mod h1:JT/LGFxPwpN+nlsTiinSYjdIx3hZIGqHCpChcIZmdoE=
go.opentelemetry.io/otel/oteltest v0.19.0/go.mod h1:tI4yxwh8U21v7JD6R3BcA/2+RBoTKFexE/PJ/nSO7IA=
go.opentelemetry.io/otel/trace v0.17.0 h1:SBOj64/GAOyWzs5F680yW1ITIfJkm6cJWL2YAvuL9xY=
go.opentelemetry.io/otel/trace v0.17.0/go.mod h1:bIujpqg6ZL6xUTubIUgziI1jSaUPthmabA/ygf/6Cfg=
go.opentelemetry.io/otel/trace v0.19.0 h1:1ucYlenXIDA1OlHVLDZKX0ObXV5RLaq06DtUKz5e5zc=
go.opentelemetry.io/otel/trace v0.19.0/go.mod h1:4IXiNextNOpPnRlI4ryK69mn5iC84bjBWZQA5DXz/qg=
You need to grep your imports for github.com/go-pg/pg
and replace all occurrences with github.com/go-pg/pg/v10
.
You can also create an empty Go module and install go-pg there to prove that everything is working as expected.
I grepped my imports and this is what I see:
% grep -r 'github.com/go-pg' .
./go.mod: github.com/go-pg/pg/v10 v10.9.0 // indirect
./internal/database/db.go: "github.com/go-pg/pg/v10"
./internal/database/db.go: "github.com/go-pg/pg/v10/orm"
./internal/database/types.go: "github.com/go-pg/pg/v10"
./internal/database/types.go: "github.com/go-pg/pg/v10/types"
./internal/database/hook.go: "github.com/go-pg/pg/v10"
./internal/database/relations.go: "github.com/go-pg/pg/v10/orm"
./internal/database/database.go: "github.com/go-pg/pg/v10"
./internal/database/listener.go: "github.com/go-pg/pg/v10"
./internal/database/filters.go: "github.com/go-pg/pg/v10/orm"
./internal/database/filters.go: "github.com/go-pg/pg/v10/types"
./internal/database/tx.go: "github.com/go-pg/pg/v10"
./go.sum:github.com/go-pg/pg/v10 v10.9.0 h1:mNIxE7H7/5fHOniVrLgUXNoIgHiJXXvhiNY+PxqtV6k=
./go.sum:github.com/go-pg/pg/v10 v10.9.0/go.mod h1:rgmTPgHgl5EN2CNKKoMwC7QT62t8BqsdpEkUQuiZMQs=
./go.sum:github.com/go-pg/zerochecker v0.2.0 h1:pp7f72c3DobMWOb2ErtZsnrPaSvHd2W4o9//8HtF4mU=
./go.sum:github.com/go-pg/zerochecker v0.2.0/go.mod h1:NJZ4wKL0NmTtz0GKCoJ8kym6Xn/EQzXRl2OnAe7MmDo=
still have the issue.
@vmihailenco I deleted my go.sum
and go.mod
and ran go mod init
, then go mod tidy
. That seems to have fixed the issue. Thanks!