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)
| 54 | // prerelease and build-metadata suffixes. A bare version without a leading "v" |
| 55 | // is also accepted (the prefix is added internally). |
| 56 | func 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. |