suggest

package
v0.162.2 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Distance(a, b string) int

Distance is the Levenshtein distance between a and b, enough for "did you mean" on short names.

func Nearest

func Nearest(name string, known map[string]bool) string

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.

Jump to

Keyboard shortcuts

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