MCPcopy Create free account
hub / github.com/celer-pkg/celer / GetMinorVersion

Function GetMinorVersion

pkgs/expr/expr.go:49–55  ·  view source on GitHub ↗

GetMinorVersion convert a version string to its major.minor part (e.g. "5.11.13" -> "5.11", "1.11" -> "1.11").

(version string)

Source from the content-addressed store, hash-verified

47// GetMinorVersion convert a version string to its major.minor part
48// (e.g. "5.11.13" -> "5.11", "1.11" -> "1.11").
49func GetMinorVersion(version string) string {
50 parts := strings.Split(version, ".")
51 if len(parts) >= 2 {
52 return parts[0] + "." + parts[1]
53 }
54 return version
55}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected