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).
()
| 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). |
| 128 | func (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. |