MCPcopy
hub / github.com/syncthing/syncthing / semanticVersion

Function semanticVersion

build.go:989–1001  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

987}
988
989func semanticVersion() (major, minor, patch int) {
990 r := regexp.MustCompile(`v(\d+)\.(\d+).(\d+)`)
991 matches := r.FindStringSubmatch(getVersion())
992 if len(matches) != 4 {
993 return 0, 0, 0
994 }
995
996 var ints [3]int
997 for i, s := range matches[1:] {
998 ints[i], _ = strconv.Atoi(s)
999 }
1000 return ints[0], ints[1], ints[2]
1001}
1002
1003func getBranchSuffix() string {
1004 bs, err := runError("git", "branch", "-a", "--contains")

Callers 1

shouldBuildSysoFunction · 0.85

Calls 1

getVersionFunction · 0.85

Tested by

no test coverage detected