-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add support to read gopb tags from proto request #170
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Some minor phone feedback.
Can you add tests and example use cases?
} | ||
} | ||
if !found { | ||
panic("Not found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this return an error instead?
func (p *Patcher) scan() error { | ||
for _, f := range p.gen.Files { | ||
p.scanFile(f) | ||
} | ||
for _, f := range p.gen.Request.ProtoFile { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put this in a new scanRequest method?
} else { | ||
p.RenameField(ident.WithChild(mident, fident.GoName), newName, embed) // Field | ||
childID := ident.WithChild(mident, fident.GoName) | ||
log.Printf("child %v parent %v", childID, mident.GoName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these debugging logs?
5a96982
to
4b09e73
Compare
4b09e73
to
25deb65
Compare
If the tags are added as part of proto request (mutating the file after generating) then these changes will help to read gopb tags