This issue is resolved after consulting 
https://github.com/golang/protobuf/issues/763

On Tuesday, August 6, 2019 at 1:15:41 AM UTC+2, Niket Agrawal wrote:
>
> 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.
> 1. Installed the protoc compiler using the pre-compiled binaries available 
> here - https://github.com/protocolbuffers/protobuf/releases . Chose 
> protobuf-3.9.0-linux-arch_64.zip package as per the instructions on the 
> link above.
> 2. Installed the protoc plugin for Go using the command go get -u 
> github.com/golang/protobuf/protoc-gen-go
>
> 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 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/c474fc82-13dc-4740-9e87-44cfe898cf06%40googlegroups.com.

Reply via email to