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
x/tools/go/packages: provide alternative to deprecated LoadAllSyntax #32365
A fair number of tools will need the equivalent of the now deprecated LoadAllSyntax constant. Instead of forcing everyone to write their own bitwise OR of 9 constants, it would be nice if we could provide a constant for this. Unfortunately we can't call it
It's possible that the tools I looked at used LoadAllSyntax out of convenience, not necessity.
However, intuitively, it seems to me that all tools that do full-fledged source based analysis will need the majority of fields in Package. They will need ASTs, they will need to resolve imports, and they will need type information. This amounts to LoadAllSyntax. Tools that need this amount of information include go/analysis runners, pre-go/analysis linters (golint, errcheck, ...) and, to a degree, code manipulation tools like goreturns, though these may not need NeedDeps, but then I'd argue that
Am I missing something? Do most tools actually need much less information than I am thinking?