(candidate pluginFile, current pluginFile)
| 202 | } |
| 203 | |
| 204 | func pluginFilePreferred(candidate pluginFile, current pluginFile) bool { |
| 205 | if candidate.Version == "" { |
| 206 | return false |
| 207 | } |
| 208 | if current.Version == "" { |
| 209 | return true |
| 210 | } |
| 211 | comparison, comparable := comparePluginVersions(candidate.Version, current.Version) |
| 212 | if !comparable { |
| 213 | return candidate.Version > current.Version |
| 214 | } |
| 215 | return comparison > 0 |
| 216 | } |
| 217 | |
| 218 | func comparePluginVersions(a, b string) (int, bool) { |
| 219 | segmentsA := strings.Split(a, ".") |
no test coverage detected