easyjson icon indicating copy to clipboard operation
easyjson copied to clipboard

Output from dependent package's init code causes fatal error

Open drichelson opened this issue 4 years ago • 1 comments

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:

  1. Somehow ignore stdout when packages get loaded
  2. If 1 is not possible I imagine we could emit a more helpful error message
  3. Update readme to list this as a known issue

drichelson avatar Jun 04 '21 16:06 drichelson

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?

eli-darkly avatar Jun 05 '21 00:06 eli-darkly