Join GitHub today
cmd/go: generate should set GOBUILDTAGS env variable #27898
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
I think the use case here goes beyond
Also, if there's a way to accomplish this already, please bring it up. Paul and myself weren't able to come up with a way, other than adding something like
I am skeptical of introducing a new GOBUILDTAGS environment variable that generate writes but that nothing else reads.
(The others that are unique to generate are GOFILE, GOLINE, GOPACKAGE, and DOLLAR, which are all easier to understand as not-read-by-the-go-command.)
Stepping back a bit just in case I'm jumping rather too quickly to a solution before properly articulating the problem.
Hence we can use the current environment's
This is where there is currently a gap, because these would need to be explicitly set: if I pass
If, however, the
So if instead of setting
Absolutely, this would work. But then these constraints would need to be maintained at the site of every
Have re-read what's written above, I can quite agree now. I don't know how we didn't come up with the effective-