kindswitch

command
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package kindswitch keeps step-kind dispatch where golangci-lint's `exhaustive` can check it.

exhaustive checks `switch kind, _ := step.Kind(); kind { ... }`: adding a StepKind makes every such switch that does not answer it fail lint. It cannot see the tagless spelling, `switch { case step.Get != "": ... }` — that is `switch true` over boolean cases, with no enum to reason about — and adding a kind once shipped six defects that were tagless sites silently doing nothing for it.

So this pass reports any tagless switch whose cases read a struct field tagged `kind:"..."` (config.Step's kind fields). The tag, not a list here, is what names a kind field.

Usage:

go run ./tools/kindswitch ./...

Jump to

Keyboard shortcuts

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