Abstract
The Analysis API is used to write analyses (like those in go vet and go lint) that can help surface bugs and show code improvements to users. I’ll show how to use and write analyses, and see their results, so you can help improve your code quality.
We’ve introduced a new framework for writing analyses for Go in the golang.org/x/tools/go/analysis package. “Analyses” are tools that inspect programs and report errors, warnings, or other helpful info. The checks done by “Lint”, “Vet”, “Errcheck”, and “Gometalinter” are examples of analyses. On the Go team, we’ve been working on making analyses easier to write and easier to surface in editors and other useful places. The talk’s purpose is to introduce the analysis framework to the audience so that they will be able to write analyses themselves. These new analyses that the attendees and the community writes might be contributed back to the above tools and help spot problems in and make improvements to all of our code. Or they may be written at various Go-using companies to ensure correct usage of proprietary libraries. In either case, this talk aims to inspire Gophercon attendees to write more analyses (and to show them how easy they are to write!) resulting in improved Go code everywhere!