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 ./...
Click to show internal directories.
Click to hide internal directories.