Using and Writing Go Analyses
summary
Shows how to use the Analysis API (golang.org/x/tools/go/analysis) to write an analyzer that finds a real bug: passing a pointer where a value is expected and misusing equality checks. Demonstrates using inspect and type info to compare argument types, reporting precise diagnostics with file/offset, and generating suggested fixes that insert a dereference. Covers building a CLI with singlechecker and wiring the analyzer into gopls/go vet/staticcheck so fixes appear as editor quick fixes.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 0:32What are analyses
- 1:01Come package
- 2:57The problem
- 3:30The solution
- 4:55Go Analyzer
- 5:11Diagnostic
- 6:01Go Vet
- 6:58Analyse Configuration
- 7:42Syntax Types
- 13:56Analysis Steps
- 15:00Facts
- 15:37Go Docs
- 15:54Suggested fixes
- 18:21Fix pointer
- 22:34Single Checker
- 23:24Contribute
- 23:46Go Please
- 24:50Thank You
- 25:07GitHub








