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

Method IsCompatibleWith

vpn/version.go:136–152  ·  view source on GitHub ↗

IsCompatibleWith returns the lowest version that is compatible with both version lists. If the versions are not compatible, the second return value will be false.

(other RPCVersionList)

Source from the content-addressed store, hash-verified

134// version lists. If the versions are not compatible, the second return value
135// will be false.
136func (vl RPCVersionList) IsCompatibleWith(other RPCVersionList) (RPCVersion, bool) {
137 bestVersion := RPCVersion{}
138 for _, v1 := range vl.Versions {
139 for _, v2 := range other.Versions {
140 if v1.Major == v2.Major && v1.Major > bestVersion.Major {
141 v, ok := v1.IsCompatibleWith(v2)
142 if ok {
143 bestVersion = v
144 }
145 }
146 }
147 }
148 if bestVersion.Major == 0 {
149 return bestVersion, false
150 }
151 return bestVersion, true
152}

Callers

nothing calls this directly

Calls 1

IsCompatibleWithMethod · 0.45

Tested by

no test coverage detected