Using and Writing Go Analyses

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.

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!

Video

Stay connected

You can subscribe to our newsletter to stay updated on the latest news and announcements. Follow us on social media to join our community and engage with other attendees, speakers, and staff. We're on Twitter, Mastodon, Youtube and Facebook. Don't forget to use our official hashtag #GoLab2023 to share your experience and connect with other attendees on social media.

Subscribe to our newsletter

We hate spam just as much as you do, which is why we promise to only send you relevant communications. We respect your privacy and will never share your information with third parties.
©2023 GoLab | The international conference on Go in Florence-Design & devCantiere Creativo-Made withDatoCMS