I will list the biggest changes.
The library go/packages is the program loader, it is the replacement of older go/loader. Golangci-lint uses the program loader to parse the whole program: extract AST, type information and then build SSA if needed. Both libraries are official libraries, but the new one has some killer features:
- it supports loading type information from a go build cache: because of that almost all linters became “fast”: they work in 1–2 seconds. Only unparam, interfacer and megacheck are “slow” linters now. An average project is analyzed 20–40% faster than before if all linters are
enabled! If we enable all linters except unparam, interfacer and
megacheck the analysis is 10–20x faster!
- it supports go modules: now we can analyze repos outside of GOPATH.
- it supports more build systems: not only go build, but e.g. bazel
Change The License From AGPL to GPL
Some organizations disallow the usage of open-source projects with AGPL license. We’ve changed the license to GPL.
We’ve supported 4 cool linters:
- go-critic: the most opinionated Go source code linter for code audit.
- scopelint: checks for unpinned variables in go programs.
- gochecknoinits: checks that no init functions are present in Go code.
- gochecknoglobals: checks that no globals are present in Go code.
- support exclude flags for errcheck
- update imports formatting: use the new goimports
- support local-prefix option for goimports: it puts imports beginning with this option after 3rd-party packages