Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rittneje opened this issue May 14, 2024 · 2 comments
Closed

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

rittneje opened this issue May 14, 2024 · 2 comments
Assignees
Labels
P3 Status: Help Wanted Type: Feature New features or improvements in behavior

Comments

@rittneje
Copy link

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.

@rittneje rittneje added the Type: Feature New features or improvements in behavior label May 14, 2024
@purnesh42H purnesh42H self-assigned this May 15, 2024
@purnesh42H
Copy link
Contributor

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.

@silves-xiang
Copy link
Contributor

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Status: Help Wanted Type: Feature New features or improvements in behavior
Projects
None yet
Development

No branches or pull requests

4 participants