Move analysis framework types into the standard library
The analysis framework, golang.org/x/tools/go/analysis, defines how analyzers (linters) talk to drivers like cmd/vet. The Go toolchain uses a vendored copy of it, and the copy's types are distinct from the x/tools ones. This blocks proposal 82464, which lets go test run the analyzers specified by the workspace. To do that, go test must build vet-like tools that link with third-party analyzers, and those analyzers are written against the x/tools types.
The proposal moves the framework's types, unchanged, into a new standard library package, go/analysis. The x/tools types become aliases of them, so the toolchain and x/tools share the same types, and existing analyzers keep working as is. The API is not redesigned: the move is the only change.
import "go/analysis"
var Analyzer = &analysis.Analyzer{
Name: "mycheck",
Doc: "reports something",
Run: func(pass *analysis.Pass) (any, error) {
pass.Reportf(pass.Files[0].Pos(), "found it")
return nil, nil
},
}
The package and the aliases will first ship behind a GOEXPERIMENT flag.
- Proposal
- #82465 by adonovan
- Status
- Implemented on Nov 19, 2026
- Release
- Go 1.28
- Impact
- low
- Area
- go/analysis