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

BUG: protoc-gen-gogofast not generate trailing comments #764

Open
hitzhangjie opened this issue Feb 22, 2023 · 0 comments · May be fixed by #765
Open

BUG: protoc-gen-gogofast not generate trailing comments #764

hitzhangjie opened this issue Feb 22, 2023 · 0 comments · May be fixed by #765

Comments

@hitzhangjie
Copy link

hitzhangjie commented Feb 22, 2023

for example, here's the protobuf:

syntax="proto3";
package hello;
...
message HelloRequest {
    // xxx111
    string msg = 1; // xxx222
}

Then execute the: protoc --gogofast_out=. hello.proto, the generated code is:

type HelloRequest struct {
    // xxx111
    Msg                  string   `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"`                                                                        
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

We could see, the trailing comments is not generated, while protoc-gen-go will handle both the leading and trailing comments. Please support this style of trailing comments.

This style of trailing comments will help align the fields, much clearer. It will improve readability. I won't have to switch between the *.pb.go and *.proto file.

@hitzhangjie hitzhangjie changed the title protoc-gen-gogofast not generate trailing comments BUG: protoc-gen-gogofast not generate trailing comments Feb 22, 2023
hitzhangjie added a commit to hitzhangjie/protobuf that referenced this issue Feb 22, 2023
hitzhangjie added a commit to hitzhangjie/protobuf that referenced this issue Feb 22, 2023
hitzhangjie added a commit to hitzhangjie/protobuf that referenced this issue Feb 22, 2023
hitzhangjie added a commit to hitzhangjie/protobuf that referenced this issue Feb 22, 2023
hitzhangjie added a commit to hitzhangjie/protobuf that referenced this issue Feb 22, 2023
hitzhangjie added a commit to hitzhangjie/protobuf that referenced this issue Feb 22, 2023
hitzhangjie added a commit to hitzhangjie/protobuf that referenced this issue Feb 22, 2023
hitzhangjie added a commit to hitzhangjie/protobuf that referenced this issue Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant