In previos products i use old protoc-gen-go which allow to use plugins and generate serialization/deserialization and gRPC client/server in same pb file
as far i understand protoc-gen-go v1.27.1 will not allow plugins and demand to use go-grpc_out flag for client\server code
Follow this command
protoc -I /usr/local/include -I $PWD/api/dummy-proto --go_out=generated --go-grpc_out=generated --go_opt=paths=source_relative proto/v1/foo.proto
i got
generated
|_proto
|_v1
|_dummy
| |_foo_grpc.pb.go //package dummy
|_foo.pb.go //package dummy
Because of created "dummy" folder foo_grpc.pb.go functions do not see Request and Response which generated in foo.pb.go
What i am doing wrong? Is there is option to generate one file as before? It will be work properly after move foo_grpc.pb.go on same level with foo.pb.go.
Also is there is possible to use old flag like --go_out=import_path="
and declare package with M without slashes and without go_options in proto like -go_out=import_path=grpc_v1_proto,M$PWD/proto/v1/foo.proto=grpc_v1_proto"
foo.proto
syntax = "proto3";
package dummy.v1.foo;
option go_package = "proto/v1/dummy";
import "proto/v1/structures.proto";
service FooService {
rpc reverse(ReverseRequest) returns (ReverseResponse);
rpc getBar(GetBarRequest) returns (GetBarResponse);
}
message ReverseRequest {
string text = 1;
}
message ReverseResponse {
string reversed_text = 1;
}
message GetBarRequest {
}
message GetBarResponse {
structures.Bar bar = 1;
}