| 138 | } |
| 139 | |
| 140 | func parseVersionNumber(input string) (int, int, int) { |
| 141 | // Version |
| 142 | trimmed := strings.TrimLeft(input, "v") |
| 143 | vSplit := strings.Split(trimmed, ".") |
| 144 | var major, minor, patch int |
| 145 | |
| 146 | switch len(vSplit) { |
| 147 | case 4: |
| 148 | fallthrough |
| 149 | case 3: |
| 150 | patch, _ = strconv.Atoi(vSplit[2]) |
| 151 | fallthrough |
| 152 | case 2: |
| 153 | minor, _ = strconv.Atoi(vSplit[1]) |
| 154 | fallthrough |
| 155 | case 1: |
| 156 | major, _ = strconv.Atoi(vSplit[0]) |
| 157 | } |
| 158 | |
| 159 | return major, minor, patch |
| 160 | } |
| 161 | |
| 162 | func parseOS(input string) OSInfo { |
| 163 | split := strings.Split(input, "-") |