(msvcDir string)
| 309 | } |
| 310 | |
| 311 | func (t Toolchain) findLatestMSVCVersion(msvcDir string) (string, error) { |
| 312 | entries, err := os.ReadDir(msvcDir) |
| 313 | if err != nil { |
| 314 | return "", err |
| 315 | } |
| 316 | |
| 317 | var latest string |
| 318 | for _, entry := range entries { |
| 319 | if entry.IsDir() { |
| 320 | name := entry.Name() |
| 321 | if latest == "" || t.compareVersion(name, latest) > 0 { |
| 322 | latest = name |
| 323 | } |
| 324 | } |
| 325 | } |
| 326 | if latest == "" { |
| 327 | return "", fmt.Errorf("no MSVC versions found in %s", msvcDir) |
| 328 | } |
| 329 | return latest, nil |
| 330 | } |
| 331 | |
| 332 | func (t Toolchain) compareVersion(first, second string) int { |
| 333 | firstVersion := strings.Split(first, ".") |
no test coverage detected