Run all linters per package. It allows unloading package data when it's
processed. It dramatically reduces memory (and CPU because of GC) usage.
Relates: #337
Set analysis pass results to nil early to garbage collect them
soon.
Memory can be reduced for the following linters:
- staticcheck
- stylecheck
- gosimple
- govet
- bodyclose
- any future go/analysis linter
Relates: #712, #634, #628, #598, #509, #483, #337
* update staticcheck
Don't fork staticcheck: use the upstream version.
Remove unneeded SSA loading.
* Cache go/analysis facts
Don't load unneeded packages for go/analysis.
Repeated run of go/analysis linters now 10x faster
(2s vs 20s on this repo) than before.
Significantly improve CPU and memory usage when not using SSA-powered linters.
Improve readability of go/packages errors.
Improve debugging capabilities and write doc about debugging.