MCPcopy Index your code
hub / github.com/coder/coder / VersionsMatch

Function VersionsMatch

buildinfo/buildinfo.go:76–84  ·  view source on GitHub ↗

VersionsMatch compares the two versions. It assumes the versions match if the major and the minor versions are equivalent. Patch versions are disregarded. If it detects that either version is a developer build it returns true.

(v1, v2 string)

Source from the content-addressed store, hash-verified

74// disregarded. If it detects that either version is a developer build it
75// returns true.
76func VersionsMatch(v1, v2 string) bool {
77 // If no version is attached, then it is a dev build outside of CI. The version
78 // will be disregarded... hopefully they know what they are doing.
79 if strings.Contains(v1, noVersion) || strings.Contains(v2, noVersion) {
80 return true
81 }
82
83 return semver.MajorMinor(v1) == semver.MajorMinor(v2)
84}
85
86func IsDevVersion(v string) bool {
87 return strings.Contains(v, "-"+develPreRelease)

Callers 5

RunMethod · 0.92
TestBuildInfoFunction · 0.92
NewFunction · 0.92
healthReportMethod · 0.92

Calls 1

ContainsMethod · 0.45

Tested by 1

TestBuildInfoFunction · 0.74