modernize: Use slices.Contains

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski
2025-12-15 18:27:58 +01:00
parent bce14ac5bc
commit 62ed24a87c
18 changed files with 50 additions and 107 deletions

View File

@@ -26,6 +26,7 @@ import (
"context"
"errors"
"fmt"
"slices"
"sync"
"time"
@@ -193,12 +194,7 @@ func (p *Plugin) implements(kind string) bool {
if p.Manifest == nil {
return false
}
for _, driver := range p.Manifest.Implements {
if driver == kind {
return true
}
}
return false
return slices.Contains(p.Manifest.Implements, kind)
}
func loadWithRetry(name string, retry bool) (*Plugin, error) {