Note that //go:generate has unusual handling of flags with spaces so the quotes have to include the flag name (example) for complex constraints. This revealed a bug in --write_generate_directive, which just prints space-delimited os.Args.
The workaround of using --copyright_file is neither viable (it adds a space between // and go:build) nor good practice as overloading functionality can result in bugs due to unanticipated usage (e.g. the aforementioned space).
Resolves #190
Note that
//go:generate
has unusual handling of flags with spaces so the quotes have to include the flag name (example) for complex constraints. This revealed a bug in--write_generate_directive
, which just prints space-delimitedos.Args
.The workaround of using
--copyright_file
is neither viable (it adds a space between//
andgo:build
) nor good practice as overloading functionality can result in bugs due to unanticipated usage (e.g. the aforementioned space).