Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶ added in v0.12.0
Compare compares two semantic versions in X.Y.Z form (a leading "v" is allowed and stripped via Normalize). It returns -1 if a < b, 0 if a == b, and 1 if a > b. A non-nil error is returned when either argument is not a valid semantic version.
func Normalize ¶
Normalize validates a semantic version and strips a leading "v". It returns the normalized version in "X.Y.Z" form.
func Parse ¶ added in v0.12.0
Parse converts a semantic version into its numeric major/minor/patch components. The input is normalized first (a leading "v" is stripped), so any value accepted by Normalize is accepted here. It returns an error when the version is invalid or a segment cannot be represented as an int.
func ParsePin ¶ added in v0.24.0
ParsePin extracts the pinned version from .agent-layer/al.version contents. Blank lines and lines starting with "#" are ignored, and exactly one version line is expected. It returns ok=false with a nil error when the contents hold no version line, and an error when there are multiple version lines or the version line is invalid.
Types ¶
This section is empty.