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

Function IsValid

pkg/semverutil/semverutil.go:56–58  ·  view source on GitHub ↗

IsValid reports whether ref is a valid semantic version string. It uses golang.org/x/mod/semver and accepts any valid semver, including prerelease and build-metadata suffixes. A bare version without a leading "v" is also accepted (the prefix is added internally).

(ref string)

Source from the content-addressed store, hash-verified

54// prerelease and build-metadata suffixes. A bare version without a leading "v"
55// is also accepted (the prefix is added internally).
56func IsValid(ref string) bool {
57 return semver.IsValid(EnsureVPrefix(ref))
58}
59
60// ParseVersion parses v into a SemanticVersion.
61// It returns nil if v is not a valid semantic version string.

Callers 9

isMinorVersionBehindFunction · 0.92
isSemanticVersionTagFunction · 0.92
TestIsValidFunction · 0.85
IsCompatibleFunction · 0.85

Calls 2

EnsureVPrefixFunction · 0.85
IsValidMethod · 0.45

Tested by 2

TestIsValidFunction · 0.68