Documentation
¶
Overview ¶
Package discover finds outdated modules and tool modules with `go list`.
Index ¶
- func CompileIgnore(patterns []string) ([]*regexp.Regexp, error)
- func Exec(dir string, args ...string) ([]byte, error)
- type Discoverer
- func (d Discoverer) DirectDependencies() (map[string]string, error)
- func (d Discoverer) MajorUpgrades(noCache bool) ([]module.Module, []func())
- func (d Discoverer) Modules() ([]module.Module, error)
- func (d Discoverer) Tools() ([]module.Module, error)
- func (d Discoverer) ToolsSupported() (bool, error)
- func (d Discoverer) Versions(name string, after *semver.Version) ([]cooldown.VersionInfo, error)
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompileIgnore ¶
CompileIgnore compiles the --ignore patterns, rejecting invalid ones up front rather than per module.
Types ¶
type Discoverer ¶
Discoverer lists the outdated modules of one module directory.
func (Discoverer) DirectDependencies ¶
func (d Discoverer) DirectDependencies() (map[string]string, error)
DirectDependencies maps each direct dependency of d.Dir to its version.
func (Discoverer) MajorUpgrades ¶
func (d Discoverer) MajorUpgrades(noCache bool) ([]module.Module, []func())
MajorUpgrades returns the major version upgrades available for d.Dir's direct dependencies, looked up through the pkg.go.dev API.
Logging is returned rather than emitted: callers run this behind a spinner, and a log line written while the spinner is drawing corrupts the line. A failed lookup is never fatal — a module the API can't answer for is one that keeps its patch and minor upgrades.
func (Discoverer) Modules ¶
func (d Discoverer) Modules() ([]module.Module, error)
Modules returns the direct dependencies that have an update available.
func (Discoverer) Tools ¶
func (d Discoverer) Tools() ([]module.Module, error)
Tools returns the module-backed tools that have an update available.
func (Discoverer) ToolsSupported ¶
func (d Discoverer) ToolsSupported() (bool, error)
ToolsSupported reports whether d.Dir's toolchain supports tool modules. `go version` selects its toolchain from the go.mod of the directory it runs in, so this has to be asked per module directory: in workspace mode members can pin toolchains straddling the 1.24 tool-module gate.
func (Discoverer) Versions ¶
func (d Discoverer) Versions(name string, after *semver.Version) ([]cooldown.VersionInfo, error)
Versions reports the tagged versions of a module newer than after, in ascending order, together with their publish times. The method value satisfies cooldown.Lookup.