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)
| 134 | // version lists. If the versions are not compatible, the second return value |
| 135 | // will be false. |
| 136 | func (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 | } |
nothing calls this directly
no test coverage detected