package versions
Import Path
golang.org/x/tools/internal/versions (on go.dev)
Dependency Relation
imports 3 packages, and imported by 2 packages
Involved Source Files
features.go
gover.go
toolchain.go
toolchain_go119.go
toolchain_go120.go
toolchain_go121.go
types.go
types_go122.go
versions.go
Package-Level Type Names (only one, which is unexported)
Package-Level Functions (total 18, in which 8 are exported)
AtLeast reports whether the file version v comes after a Go release.
Use this predicate to enable a behavior once a certain Go release
has happened (and stays enabled in the future).
Before reports whether the file version v is strictly before a Go release.
Use this predicate to disable a behavior once a certain Go release
has happened (and stays enabled in the future).
Compare returns -1, 0, or +1 depending on whether
x < y, x == y, or x > y, interpreted as Go versions.
The versions x and y must begin with a "go" prefix: "go1.21" not "1.21".
Invalid versions, including the empty string, compare less than
valid versions and equal to each other.
The language version "go1.21" compares less than the
release candidate and eventual releases "go1.21rc1" and "go1.21.0".
Custom toolchain suffixes are ignored during comparison:
"go1.21.0" and "go1.21.0-bigcorp" are equal.
FileVersion returns a file's Go version.
The reported version is an unknown Future version if a
version cannot be determined.
GoVersion returns the Go version of the type package.
It returns zero if no version can be determined.
InitFileVersions initializes info to record Go versions for Go files.
IsValid reports whether the version x is valid.
Lang returns the Go language version for version x.
If x is not a valid version, Lang returns the empty string.
For example:
Lang("go1.21rc2") = "go1.21"
Lang("go1.21.2") = "go1.21"
Lang("go1.21") = "go1.21"
Lang("go1") = "go1"
Lang("bad") = ""
Lang("1.21") = ""
Package-Level Variables (only one, which is unexported)
Package-Level Constants (total 6, all are exported)
Future is an invalid unknown Go version sometime in the future.
Do not use directly with Compare.
GoVersions that features in x/tools can be gated to.
GoVersions that features in x/tools can be gated to.
GoVersions that features in x/tools can be gated to.
GoVersions that features in x/tools can be gated to.
GoVersions that features in x/tools can be gated to.
The pages are generated with Golds v0.7.6. (GOOS=linux GOARCH=amd64)