rcNumber returns the numeric RC identifier (e.g. 0 for "rc.0"). It returns -1 when the version is not an RC.
()
| 46 | // rcNumber returns the numeric RC identifier (e.g. 0 for "rc.0"). |
| 47 | // It returns -1 when the version is not an RC. |
| 48 | func (v version) rcNumber() int { |
| 49 | if !v.IsRC() { |
| 50 | return -1 |
| 51 | } |
| 52 | n, err := strconv.Atoi(strings.TrimPrefix(v.Pre, "rc.")) |
| 53 | if err != nil { |
| 54 | return -1 |
| 55 | } |
| 56 | return n |
| 57 | } |
| 58 | |
| 59 | func (v version) GreaterThan(b version) bool { |
| 60 | if v.Major != b.Major { |