Skip to content

Conversation

@MSalopek
Copy link

This should enable the user to choose whether or not they want all code to be generated or just the code that returns a map of all available methods -> by using the flag "skip-defaults".
Also, Headers and Footers get renamed: HeaderFileName and FooterFileName so every file would have different header and footer names.
Please review.

@awalterschulze
Copy link
Member

Is it possible to only give each file unique Header and Footer names, to avoid same func and var names?
That way we won't need another flag?

@MSalopek
Copy link
Author

I'm sorry, would you please elaborate your idea? Thanks!

@awalterschulze
Copy link
Member

awalterschulze commented Mar 19, 2018 via email

@MSalopek
Copy link
Author

MSalopek commented Mar 19, 2018

It is possible, yes. But the name func NewHandler will remain the same for all the files, that is something you would like to keep?

p.P(`var Form`, servName, "_", generator.CamelCase(method.GetName()), " string = `", s, "`")
}
func processFileName (inStr string) string {
reg, err := regexp.Compile("[^a-zA-Z0-9]+")
Copy link
Member

Choose a reason for hiding this comment

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

regexp.MustCompile and then it could rather be done as part of init or a var.

var alphaNum = regexp.MustCompile("[^a-zA-Z0-9]+")

return processed
}

func (p *html) Generate(file *generator.FileDescriptor) {
Copy link
Member

Choose a reason for hiding this comment

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

Technically the html struct has state.
So it can remember to only generate some things once itself per package, without using a flag.
What do you think about that proposal?

Sorry for pushing this, but I want to try and keep things as simple as possible.

Copy link
Member

Choose a reason for hiding this comment

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

Then we also don't need custom HeaderFooterName

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