typo

package
v2.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advisor

type Advisor struct {
	// contains filtered or unexported fields
}

Advisor is a utility that helps augment errors with guidance when mistakes are made in configuration.

func NewAdvisor

func NewAdvisor() *Advisor

func (*Advisor) AddTerm

func (advisor *Advisor) AddTerm(item string)

AddTerm records that we saw the specified item

func (*Advisor) ClearTerms

func (advisor *Advisor) ClearTerms()

ClearTerms removes all the terms from ths advisor

func (*Advisor) Errorf

func (advisor *Advisor) Errorf(typo string, format string, args ...interface{}) error

Errorf creates a new error with advice, or a simple error if no advice possible

func (*Advisor) HasTerm

func (advisor *Advisor) HasTerm(term string) bool

HasTerm returns true if the specified term is known to the advisor

func (*Advisor) HasTerms

func (advisor *Advisor) HasTerms() bool

HasTerms returns true if this advisor has any terms available

func (*Advisor) Wrapf

func (advisor *Advisor) Wrapf(originalError error, typo string, format string, args ...interface{}) error

Wrapf adds any guidance to the provided error, if possible

Jump to

Keyboard shortcuts

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