Plugins: Tidy up CLI code (#67813)

* more tidying

* move some things around

* more tidying

* fix linter
This commit is contained in:
Will Browne
2023-05-08 10:58:47 +02:00
committed by GitHub
parent 0fc9a47779
commit e0e2535c96
16 changed files with 307 additions and 298 deletions
@@ -127,7 +127,7 @@ func osAndArchString() string {
return osString + "-" + arch
}
func supportsCurrentArch(version *models.Version) bool {
func supportsCurrentArch(version models.Version) bool {
if version.Arch == nil {
return true
}
@@ -139,10 +139,10 @@ func supportsCurrentArch(version *models.Version) bool {
return false
}
func latestSupportedVersion(plugin *models.Plugin) *models.Version {
func latestSupportedVersion(plugin models.Plugin) *models.Version {
for _, v := range plugin.Versions {
ver := v
if supportsCurrentArch(&ver) {
if supportsCurrentArch(ver) {
return &ver
}
}