How to fix conflicts with this error message?

4/16/2020

With go mod tidy I've updated protobuf to github.com//golang/protobuf@v1.4.0
my project uses github.com/ericchiang/k8s@v1.2.0 I build binary and when I try to run it I'm getting this panic error:

panic: mismatching message name: got k8s.io.kubernetes.pkg.watch.versioned.Event, want github.com/ericchiang.k8s.watch.versioned.Event

goroutine 1 [running]:
google.golang.org/protobuf/internal/impl.legacyLoadMessageDesc(0x1f8d6c0, 0x1b85dc0, 0x1ce794f, 0x2f, 0x0, 0x0)
        /home/andriy/go/pkg/mod/google.golang.org/protobuf@v1.21.0/internal/impl/legacy_message.go:136 +0x882
google.golang.org/protobuf/internal/impl.legacyLoadMessageInfo(0x1f8d6c0, 0x1b85dc0, 0x1ce794f, 0x2f, 0x4f7b57)
        /home/andriy/go/pkg/mod/google.golang.org/protobuf@v1.21.0/internal/impl/legacy_message.go:48 +0xbd
google.golang.org/protobuf/internal/impl.Export.LegacyMessageTypeOf(0x1f4f0a0, 0x0, 0x1ce794f, 0x2f, 0xc000399360, 0xc0000a00d0)
        /home/andriy/go/pkg/mod/google.golang.org/protobuf@v1.21.0/internal/impl/legacy_export.go:35 +0xa5
github.com/golang/protobuf/proto.RegisterType(0x1f4f0a0, 0x0, 0x1ce794f, 0x2f)
        /home/andriy/go/pkg/mod/github.com/golang/protobuf@v1.4.0-rc.4.0.20200313231945-b860323f09d0/proto/registry.go:186 +0x4d
github.com/ericchiang/k8s/watch/versioned.init.0()
        /home/andriy/go/pkg/mod/github.com/ericchiang/k8s@v1.2.0/watch/versioned/generated.pb.go:70 +0x4b

is there anyway to fix this, or should I downgrade protobuf to v1.3.5

-- Andriy Tymkiv
go
kubernetes
proto
protocol-buffers

0 Answers