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

Allow for less verbose calling of Generate #3

Open
ggutoski opened this issue May 29, 2020 · 0 comments
Open

Allow for less verbose calling of Generate #3

ggutoski opened this issue May 29, 2020 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@ggutoski
Copy link
Contributor

Currently, the idiomatic way to call bavard.Generate is as follows:

bavard.Generate("pairing/constants.go", src, d,
	bavard.Package("pairing"),
	bavard.Apache2("ConsenSys AG", 2020),
	bavard.GeneratedBy("gurvy/internal/generators"),
)

That's a lot of boilerplate. In particular, the license and GeneratedBy arguments are likely to be identical for every single call.

What's a good way to reduce the boilerplate? Is it acceptable to expose package-level variables for, say, license and "generated by" so that the user can initialize these values once and not have to copy them in every call?

@ggutoski ggutoski added the question Further information is requested label May 29, 2020
@Tabaie Tabaie self-assigned this Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants