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
proposal: cmd/vet: refactor to be cheaper #19732
The structure of vet is to have a set of checks, each of which walks the whole AST. This is expensive. It might be possible to refactor it to walk the AST once and do all the work in one pass, or at least to fold many of the locally identifiable issues into a single such pass.
For example, #19675 is not worth a full AST walk but is worth a function call on every constant.
I'm confused. I thought vet already did a single AST walk and called relevant checks for each node:
Of course, each checker might do non-trivial work once it is running, but I don't think that is a big problem at the moment.