Documentation
¶
Overview ¶
Package a11ylint provides a go/analysis Analyzer that enforces the "every visible state has a label" accessibility constraint on the go-map overlay types whose Label field is currently consumed by the a11y path. It reports composite literals of mapview.Marker or mapview.InfoWindowAction that omit Label or set it to an empty string constant.
Scope limitations — stated so false-confidence does not accrue:
- Polyline / Polygon / Circle carry a Label field but none of the current a11y or focus paths read it. Enforcing the field today would be lint theater. Expand the Analyzer when those overlays grow actual screen-reader wiring.
- Positional composite literals are skipped. None of the target structs are ergonomic positionally; the AST shape differs. If a consumer writes one, the lint will not catch it.
- Field-by-field construction (var m Marker; m.Label = "x") is invisible to this pass. Composite-literal construction is the idiomatic form across the codebase and examples.
- _test.go files are skipped by default. Internal tests construct overlays for geometry/state verification and intentionally exercise no-Label fallback paths. Pass -tests to include them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Analyzer = &analysis.Analyzer{ Name: "a11ylint", Doc: "reports mapview overlays that lack an accessibility Label.", Run: run, Requires: []*analysis.Analyzer{inspect.Analyzer}, }
Analyzer is the exported go/analysis entrypoint. Embed in a golangci-lint custom plugin or run standalone via cmd/a11ylint.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.