Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/vet: reject flag.Parse during func init #33190
We could add a special runtime hook of some kind to allow flag to see whether main.main has started, but that would be unfortunate.
A vet check, on by default during go test, seems like the perfect compromise to me.
A vet check would be very helpful, if it’s accomplishable, as the current output is confusing and misleading. Example:
I'm honestly a bit shocked that such a change went through. This (IMHO) is worse than the original problem being fixed.