Protobuf package mismatch

18 views
Skip to first unread message

nick...@gmail.com

unread,
Aug 6, 2019, 7:20:14 AM8/6/19
to grpc.io
Hello,

I'm following the instructions given here https://grpc.io/docs/quickstart/go/ to get started with GRPC in Go.

To install the Protocol Buffers v3, it is mentioned in the above link that the pre-compiled binaries for your platform can be downloaded, extracted and added to the PATH. I picked the protoc-3.9.0-linux-x86-arch_64.zip. Following this I installed the protoc plugin for Go using the command  go get -u github.com/golang/protobuf/protoc-gen-go 

Output of the protoc --version : libprotoc 3.9.0

In my .proto file I specify the syntax as proto3 and then compile it to generate the .pb.go file which has a below compile time assertion in it.

// This is a compile-time assertion to ensure that this generated file

// is compatible with the proto package it is being compiled against.

// A compilation error at this line likely means your copy of the

// proto package needs to be updated.

const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 

When I use the .pb.go file in another project the compilation fails pointing to this very same error so proto package needs to be updated. But, I don't understand why is an update needed when already the latest version is installed?

Could someone please clarify this problem?

Regards,
Niket

Niket Agrawal

unread,
Aug 6, 2019, 1:08:08 PM8/6/19
to grpc.io
This issue is now resolved after consulting https://github.com/golang/protobuf/issues/763
Reply all
Reply to author
Forward
0 new messages