Static Analysis in Go
summary
Shows how to use Go’s parser and type checker from the standard library to build go vet–style checks: AST walking with parser.ParseFile and ast.Inspect, types.Config/types.Info and the default importer to get precise types, then flag issues. Concrete examples: enforce minimum function-name length, detect incorrect use of == on time.Time and recommend t.Equal, and a real-world iterator Next/Close checker that tracks call objects to warn when Close is never called. Mentions SSA-based analysis as a next step and cautions about reflection, unsafe and cgo where static checks often fail.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 0:23What is static analysis
- 3:17Why Go suits analysis
- 5:25Parsing code to AST
- 8:38Enforcing function names
- 10:27Time comparison gotcha
- 16:52Detecting missing cleanup
- 23:37Challenges in Go
- 24:41Tips for writing checks
- 26:04Resources and next steps
- 28:10Q&A session








