protoc-gen-go-grpc: Header text from .proto file isn't brought over to the *_grpc.pb.go files
The base protoc-gen-go plugin copies any header comment(s) from the .proto file, but protoc-gen-go-grpc does not.
Use case(s) - what problem will this feature solve?
We use file headers for copyright/legal information; our source files (including generated ones) need to have our header comment block in them.
Without protoc-gen-go-grpc doing it like protoc-gen-go does, we'll have to add an additional step to get that comment added.
Proposed Solution
Mirror what protoc-gen-go does, and copy any header comments (anything before the syntax = ....; line?)
Alternatives Considered
Workaround in our generation process, to manually add the comment.
Additional Context
Can add if needed, but the issue seems straightforward to me.
We would be happy to review if you can send a PR for this. Thanks.
I'm not sure what you mean. I don't know how protoc-gen-go does it, I just know this plugin doesn't.
I don't think it's necessarily a bug, just a missing feature; I assumed the maintainers of this plugin would know best on how to go about getting it added.
If you're saying you're not going to spend any dev effort on doing it, then sure, I'll learn the code and figure out how it works, since it would be a useful feature to have.
Yes, I agree this is a good to have feature. But we don't have the dev cycles to get to this any time soon. So, if you would like to contribute a change, we will be more than happy to review it. Thanks.
I have working code, but the example I got it from uses an internal field. Maybe I'll make a PR and you all can advise to a better solution?
Sure, please send a PR and we will review it. Thanks.
Created the PR above. You can see from the "Testing vet-proto" stage the header comment in the _grpc.pb.go files.
The PR has been merged in #5540, closing this issue.