typeswitchlint

command
v1.10.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL