extractVersion extracts version from a string and removes the optional "v" or "V" prefix
(s string)
| 98 | |
| 99 | // extractVersion extracts version from a string and removes the optional "v" or "V" prefix |
| 100 | func extractVersion(s string) string { |
| 101 | matches := versionReg.FindStringSubmatch(s) |
| 102 | if len(matches) < 2 { |
| 103 | return "" |
| 104 | } |
| 105 | |
| 106 | // Return the first capture group which contains just the version numbers |
| 107 | return matches[1] |
| 108 | } |
no outgoing calls