Expand description
§use-go-version
Go version and toolchain primitives for RustUse.
§Experimental
use-go-version is experimental while use-go remains below 0.3.0.
§Example
use use_go_version::{GoToolchainVersion, GoVersion};
let version: GoVersion = "go1.22.0".parse()?;
let toolchain = GoToolchainVersion::new(version);
assert_eq!(version.major(), 1);
assert_eq!(version.minor(), Some(22));
assert_eq!(version.patch(), Some(0));
assert_eq!(version.to_string(), "1.22.0");
assert_eq!(toolchain.to_string(), "go1.22.0");§Scope
- Lightweight Go version labels such as
1,1.21, andgo1.22.0. - Toolchain and compatibility wrappers around parsed Go versions.
- Version-family helpers for major Go release lines.
§Non-goals
- Hardcoded Go release support windows or EOL dates.
- Full Go toolchain discovery.
- Shelling out to
go version. - Module compatibility decisions.
§License
Licensed under either Apache-2.0 or MIT.
Structs§
- GoCompatibility
Version - Go compatibility version metadata.
- GoMajor
Version - Major component of a Go version.
- GoMinor
Version - Minor component of a Go version.
- GoPatch
Version - Patch component of a Go version.
- GoToolchain
Version - Go toolchain version metadata.
- GoVersion
- Parsed Go version metadata.
Enums§
- GoVersion
Family - Go major release family.
- GoVersion
Parse Error - Error returned when a Go version label is invalid.