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 configurability to match usage #8

Open
dagood opened this issue Jan 13, 2023 · 0 comments
Open

Add configurability to match usage #8

dagood opened this issue Jan 13, 2023 · 0 comments

Comments

@dagood
Copy link
Member

dagood commented Jan 13, 2023

As of writing, the prototype accepts a text/template file to fill in and write to disk, but all of the generated code is given to it as a single piece of data. It might make sense to improve on that, or maybe scrap the template for some other approach. With program arguments for things like package name, I think it wouldn't be hard to have the generator simply create the full file.

The way methods are filtered could also be improved. In the prototype, you pass a single regex. (| works.) My concern is that it could get unwieldy. A few ways forward:

  • Use multiple go generate directives per distinct set of APIs.
    • Performance problem: the prototype scans some full tables to index them in memory, which would be repeated.
  • Scan a Go file for //winmdsigs ... comments that tell the generator what to do. (Like //sys comments.)
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

No branches or pull requests

1 participant