Skip to main content

Crate use_go_version

Crate use_go_version 

Source
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, and go1.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§

GoCompatibilityVersion
Go compatibility version metadata.
GoMajorVersion
Major component of a Go version.
GoMinorVersion
Minor component of a Go version.
GoPatchVersion
Patch component of a Go version.
GoToolchainVersion
Go toolchain version metadata.
GoVersion
Parsed Go version metadata.

Enums§

GoVersionFamily
Go major release family.
GoVersionParseError
Error returned when a Go version label is invalid.