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

Add support to read gopb tags from proto request #170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sudhiaithal
Copy link

@sudhiaithal sudhiaithal commented Aug 12, 2024

If the tags are added as part of proto request (mutating the file after generating) then these changes will help to read gopb tags

Copy link
Contributor

@ydnar ydnar left a 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")
Copy link
Contributor

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 {
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these debugging logs?

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 this pull request may close these issues.

2 participants