# Packages
Package gover implements support for Go toolchain versions like 1.21.0 and 1.21rc1.
# Functions
Compare returns -1, 0, or +1 depending on whether x < y, x == y, or x > y, interpreted as toolchain versions.
FromGoMod returns the go version from the go.mod file.
FromGoWork returns the go version from the go.mod file.
FromToolchain returns the Go version for the named toolchain, derived from the name itself (not by running the toolchain).
GoModLookup takes go.mod or go.work content, finds the first line in the file starting with the given key, and returns the value associated with that key.
IsLang reports whether v denotes the overall Go language version and not a specific release.
IsPrerelease reports whether v denotes a Go prerelease version.
IsToolchain reports whether the module path corresponds to the virtual, non-downloadable module tracking go or toolchain directives in the go.mod file.
IsValid reports whether the version x is valid.
Lang returns the Go language version.
Local returns the local Go version, the one implemented by this go command.
LocalToolchain returns the local toolchain name, the one implemented by this go command.
Max returns the maximum of x and y interpreted as toolchain versions, compared using Compare.
ModCompare returns the result of comparing the versions x and y for the module with the given path.
ModIsPrefix reports whether v is a valid version syntax prefix for the module with the given path.
ModIsPrerelease reports whether v is a prerelease version for the module with the given path.
ModIsValid reports whether vers is a valid version syntax for the module with the given path.
ModMajorMinor returns the "major.minor" truncation of the version v, for use as a prefix in "@patch" queries.
ModSort is like module.Sort but understands the "go" and "toolchain" modules and their version ordering.
Prev returns the Go major release immediately preceding v, or v itself if v is the first Go major release (1.0) or not a supported Go version.
ToolchainMax returns the maximum of x and y interpreted as toolchain names, compared using Compare(FromToolchain(x), FromToolchain(y)).
# Constants
DefaultGoModVersion is the Go version to assume for go.mod files that do not declare a Go version.
DefaultGoWorkVersion is the Go version to assume for go.work files that do not declare a Go version.
ExplicitIndirectVersion is the Go version at which a module's go.mod file is expected to list explicit requirements on every module that provides any package transitively imported by that module.
goStrictVersion is the Go version at which the Go versions became "strict" in the sense that, restricted to modules at this version or later, every module must have a go version line ≥ all its dependencies.
narrowAllVersion is the Go version at which the module-module "all" pattern no longer closes over the dependencies of tests outside of the main module.
separateIndirectVersion is the Go version at which "// indirect" dependencies are added in a block separate from the direct ones.
tidyGoModSumVersion is the Go version at which 'go mod tidy' preserves go.mod checksums needed to build test dependencies of packages in "all", so that 'go test all' can be run without checksum errors.
# Variables
No description provided by the author
Startup records the information that went into the startup-time version switch.
TestVersion is initialized in the go command test binary to be $TESTGO_VERSION, to allow tests to override the go command's idea of its own version as returned by Local.
# Structs
A TooNewError explains that a module is too new for this version of Go.
# Interfaces
A Switcher provides the ability to switch to a new toolchain in response to TooNewErrors.