grpc / grpc-go

The Go language implementation of gRPC. HTTP/2 based RPC

Home Page:https://grpc.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

protoc-gen-go-grpc: copy service comment to interfaces

rittneje opened this issue · comments

Use case(s) - what problem will this feature solve?

We can add comments to a service in our proto file.

// Here we can document how the service works, when to use it, etc.
service MyService {
}

However, they are currently completely ignored by protoc-gen-go-grpc. It instead puts a boilerplate comment on the client and server interfaces.

// MyServiceClient is the client API for MyService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type MyServiceClient interface {
}
// MyServiceServer is the server API for MyService service.
// All implementations must embed UnimplementedMyServiceServer
// for forward compatibility
type MyServiceServer interface {
}

Proposed Solution

Fix protoc-gen-go-grpc to copy over the comments from the service to the interfaces instead of the boilerplate comments.

Note that generators for other languages already do this properly.

Alternatives Considered

None.

Additional Context

None.

This is a good to have feature but currently considered lower priority for the team. We would be happy to review if you can send a PR for this. Thanks.

@purnesh42H Hello, This Bug, i was fix in my latest commit, already create PR, if you have any question, please point out.I will modify it immediately, Thanks!