Hello,
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