kevinconway / wrapgen

Interface wrapper generator for Go
Apache License 2.0
26 stars 9 forks source link

Add option to write to a destination file #11

Closed kevinconway closed 4 years ago

kevinconway commented 4 years ago

Defaulting to STDOUT is useful for creating script pipelines but it is difficult to use with go:generate. There is no way to pipe and redirect STDOUT in the go:generate comment syntax without breaking the abstraction and adding something like sh -c "<command>".

This new option preserves backwards compatibility by keeping STDOUT the default output but offers a new option of specifying --destination which switches the output to a specified file.