Open jhamill34 opened 4 months ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
I'm realizing that this fix works until you run go generate ./...
and then the issue comes back because the added flag needs to be present in the generate command in the file's header. So for this solution to work it'll need to play nice with the existing -tag
flag.
For example:
// go:generate go run github.com/google/wire gen -mod=readonly
Fixes #403
Problem
After trying to run
wire ./...
on a module inside of a go workspace subsequent calls togo generate ./...
failThis is because the
wire_gen.go
files contain the following generate command (see #403 for more details)Solution
This fix adds a flag to the compiled binary to allow this flag to be either unset or overridden with a different value.
For example running this command:
Would generate the following
wire_gen.go
file