Help us shape the future of Go! Take the 2026 Go Developer Survey

providers

package
v1.13.0-dev.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package providers chooses the analyzers a run invokes: the entries of the provider list that claim a language in scope, each with the executable its command resolves to. A command is resolved on the local filesystem alone and is never fetched, so an entry whose command resolves to nothing is refused rather than acquired.

Index

Constants

This section is empty.

Variables

View Source
var ErrRelativeCommand = errors.New("a command is a name looked up on PATH or an absolute path")

ErrRelativeCommand reports a command that is a path but not an absolute one, which is neither of the two forms a command takes.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	// Executable is the file the entry's command resolves to, which the run
	// executes in place of the command as written.
	Executable string

	Entry config.Provider
}

Analyzer is one provider entry a run invokes.

func Select

func Select(entries []config.Provider, inScope []string) ([]Analyzer, error)

Select returns the analyzers a run over the languages in scope invokes, in the order of entries: every entry claiming at least one of them, two entries claiming one language included, and no other.

A language in scope that no entry claims is a *config.Error naming every such language, reported before any command is resolved. Otherwise an entry whose command resolves to no executable is a *CommandError, one joined per such entry in the order of entries.

type CommandError

type CommandError struct {
	// Err is why: an [*exec.Error] from the lookup, or [ErrRelativeCommand].
	Err error

	Name  string // the entry's analyzer name
	Index int    // the entry's place in the provider list
}

CommandError is a provider entry the run invokes whose command resolves to no executable file.

func (*CommandError) Error

func (e *CommandError) Error() string

Error names the analyzer and the provider entry.

func (*CommandError) Unwrap

func (e *CommandError) Unwrap() error

Unwrap is why the command resolves to nothing.

Jump to

Keyboard shortcuts

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