Documentation
¶
Overview ¶
Command typeswitchlint finds type switch statements on values.Value or values.Number that may be missing cases for concrete types.
It works by parsing Go source files with go/ast, finding type switch statements, extracting case types, and comparing against a known list of concrete types. Switches with a default branch are reported as informational rather than warnings, since the default may already handle unknown types.
Usage:
go run ./cmd/typeswitchlint [dir...]
If no directories are given, it scans the current directory recursively.
Click to show internal directories.
Click to hide internal directories.