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

cli: Generate Go types and bindings in an adjacent file #81

Closed
sdboyer opened this issue Oct 27, 2022 · 1 comment · Fixed by #84
Closed

cli: Generate Go types and bindings in an adjacent file #81

sdboyer opened this issue Oct 27, 2022 · 1 comment · Fixed by #84
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@sdboyer
Copy link
Contributor

sdboyer commented Oct 27, 2022

Currently, the Go types and bindings generator in the CLI generate to stdout. This isn't terribly idiomatic - proto sets the general pattern here, with generating an adjacent file. It's probably generally more convenient for callers, anyway.

This is especially problematic for bindings, though, because the generating an embed.FS that will reliably work when passed to load.InstancesWithThema (or any such function we could write) requires being able to inspect the disk environment where the generated file will land. That's impossible on stdout.

So we'll have both of those generators default to generating an adjacent file (<name>_types_gen.go, <name>_bindings_gen.go), and if bindings are forced to stdout, just not allow an embed to be generated at all - it's up to the caller to make it sane.

@sdboyer sdboyer added bug Something isn't working enhancement New feature or request labels Oct 27, 2022
@sdboyer sdboyer self-assigned this Oct 27, 2022
@sdboyer
Copy link
Contributor Author

sdboyer commented Oct 27, 2022

cc @marefr - taking your advice on this one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant