suggest

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 2 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 that was likely meant by one that is not known, so that an error can ask "did you mean" it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Closest

func Closest(name string, allowed []string) string

Closest returns the name of allowed closest to name, when one is close enough to be what was meant: two edits from it at most, and no more than half its length. One that differs from name only in case, as api_url does from API_URL, is closest.

func Hint

func Hint(name string, allowed []string) string

Hint returns the question that follows an error about name, which is not among allowed: "; did you mean" the name Closest finds, or an empty string when none is close enough.

func Within

func Within(name string, allowed []string, edits int) string

Within returns the name of allowed closest to name, when it is edits edits from it at most, or differs from it only in case. It is for names among which one two edits away is as likely another as the one meant, as body is two from code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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