Documentation
¶
Overview ¶
Package goversion answers questions about the Go toolchain: whether it is new enough, and which Go version a tool's modfile should declare.
Index ¶
Constants ¶
const Inherit = "inherit"
Inherit is the go version setting that takes the version from the project.
const Min = "1.24"
Min is the oldest Go gotools can manage tools with.
Variables ¶
This section is empty.
Functions ¶
func Lang ¶
Lang turns `go env GOVERSION` output into a go-directive language version: "go1.27.0" -> "1.27", "go1.27rc1" -> "1.27", "devel go1.28-abc123 Tue ..." -> "1.28". It returns "" when no Go version is present.
func MeetsMin ¶
MeetsMin compares X.Y numerically, using the first X.Y pair in each string ("1.24.3", "go1.24", "devel go1.26-abc"). The second result is false when either side has no X.Y pair; the first is then false too.
func Require ¶
Require checks that go is installed and at least Min. Every failure is an Environment error.
Types ¶
This section is empty.