Hello,
I'm using protobuf with GROC in Golang. I followed the instructions on the GRPC quick start for Go here
https://grpc.io/docs/quickstart/go/. Following are the steps I took to install the needed software and tools.
protoc version is libprotoc 3.9.0 as checked after completing the above steps.
I proceeded with creating a simple .proto file with the following content.
---------------------------------------------------------------------
syntax = "proto3";
package api;
service HiService{
rpc SayHi (HiRequest) returns (HiResponse);
}
message HiRequest{
string hi = 1;
}
message HiResponse{
string hireply = 1;
}
--------------------------------------------------------------------
To generate the corresponding .pb.go file I used the command -> protoc --go_out=. file.proto. The .pb.go file has a compile time assertion in it (pasted below) that checks for proto package version and says that if the compilation fails at this particular line, proto package needs to be updated.
// 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
The .proto and .pb.go files were compiled together with another project and the compilation failed pointing out exactly the very same compile time assertion line in the code.
I do not understand how there is a mismatch in the package versions in the first place? and how do I make them consistent?
Regards,
Niket