Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare compares two semantic version strings. Returns -1 if v1 < v2, 0 if v1 == v2, or 1 if v1 > v2. Handles versions with different numbers of components by treating missing components as 0.
func ExtractMajor ¶
ExtractMajor extracts the major version number from a version string. For example, "v1.2.3" returns 1.
func ExtractMajorMinor ¶
ExtractMajorMinor extracts the major and minor version numbers from a version string. For example, "v1.2.3" returns (1, 2).
func Normalize ¶
Normalize normalizes a version string by removing leading/trailing whitespace and the "v" prefix if present (e.g., "v1.2.3" becomes "1.2.3").
func ToMajorTag ¶
ToMajorTag converts a version string to just the major version tag. For example, "v5.2.0" returns "v5", "5.2.0" returns "v5".
Types ¶
This section is empty.