Documentation
¶
Overview ¶
Package suggest finds the name somebody most likely meant, for a "did you mean" beside an error.
One implementation, shared by the descriptor checks in internal/cli and the configuration file in pkg/config, so a misspelled name reads the same wherever it was written.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Distance ¶
Distance is the Levenshtein distance between a and b, enough for "did you mean" on short names.
func Nearest ¶
Nearest returns the known name closest to name, or "" when nothing is close enough.
The suggestion is most of the value: "iaac is not a control" leaves someone scanning a list, and "did you mean iac?" ends it. The threshold keeps it honest, a wild guess beside an error is worse than no guess, because it sends the reader somewhere wrong.
Types ¶
This section is empty.