MCPcopy Create free account
hub / github.com/github/gh-aw / IsPreciseVersion

Method IsPreciseVersion

pkg/semverutil/semverutil.go:128–132  ·  view source on GitHub ↗

IsPreciseVersion returns true if the version has explicit minor and patch components (i.e., at least two dots in the version string, e.g. "v6.0.0" is precise, "v6" is not).

()

Source from the content-addressed store, hash-verified

126// IsPreciseVersion returns true if the version has explicit minor and patch components
127// (i.e., at least two dots in the version string, e.g. "v6.0.0" is precise, "v6" is not).
128func (v *SemanticVersion) IsPreciseVersion() bool {
129 versionPart := strings.TrimPrefix(v.Raw, "v")
130 dotCount := strings.Count(versionPart, ".")
131 return dotCount >= 2
132}
133
134// IsNewer returns true if this version is newer than other.
135// Uses Compare for proper semantic version comparison.

Calls 1

CountMethod · 0.45