easyjson
easyjson copied to clipboard
Output from dependent package's init code causes fatal error
I'm guessing this is the cause of #333
Here is a repo that reproduces the issue. See the readme for instructions.
Some ideas for making this better:
- Somehow ignore stdout when packages get loaded
- If 1 is not possible I imagine we could emit a more helpful error message
- Update readme to list this as a known issue
From what I've seen of the internals of the easyjson generator, I'm unclear on why it's necessary to use this mechanism based on capturing standard output. Is there a reason that the code that's built in bootstrap.go can't take a filename from a command-line argument or an environment variable, and tell the generator to write to that file instead of to os.Stdout?