wire
wire copied to clipboard
--header_file flag is not in generated codeg
Describe the bug
When using the --header_file flag the resulting generated file has the following go generate line:
//go:generate wire
This implies when someone later runs go generate ./..., the header file that was originally in the file will be removed.
To Reproduce
wire --header_file=./path/to/header/file
go generate
Expected behavior
After running wire with the --header_file flag, running go generate again would not produce a delta.
Version
v0.3.0
Additional context
How would you expect this to work? Would you want wire to emit something like
go:generate wire --header_file=./path/to/header/file
? That path may not exist for a subsequent call to go generate....
I think I would want that or an option to not include the go generate line
WDYT about always omitting the //go:generate wire line if a header is provided? It seems like a signal that the user is not actually using go generate to generate the file, but some other script/process.
@zombiezen
I am bit concerned to add too much logic here: folks that use Wire in complex builds should likely be using a tool more sophisticated than go generate.
Does that imply the go generate line should be removed from the generated output?
--output_file_prefix has the same issue.