MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / pluginFilePreferred

Function pluginFilePreferred

internal/pluginhost/platform.go:204–216  ·  view source on GitHub ↗
(candidate pluginFile, current pluginFile)

Source from the content-addressed store, hash-verified

202}
203
204func 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
218func comparePluginVersions(a, b string) (int, bool) {
219 segmentsA := strings.Split(a, ".")

Callers 1

Calls 1

comparePluginVersionsFunction · 0.85

Tested by

no test coverage detected