mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-05 08:02:13 +00:00
There are more numbers in the Go version now
This commit is contained in:
parent
d62820acf9
commit
d7dc37b3c4
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"regexp"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@ -139,9 +140,11 @@ func byPlatform(s string) string {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var numericGoVersion = regexp.MustCompile(`^go[0-9]\.[0-9]+`)
|
||||||
|
|
||||||
func byCompiler(s string) string {
|
func byCompiler(s string) string {
|
||||||
if strings.HasPrefix(s, "go1.") && len(s) >= 5 {
|
if m := numericGoVersion.FindString(s); m != "" {
|
||||||
return s[:5]
|
return m
|
||||||
}
|
}
|
||||||
return "Other"
|
return "Other"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user