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.
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.