chore: Use slices package where possible (#6585)

* chore: Use slices package where possible

* More, mostly using ContainsFunc

* Even more slice operations
This commit is contained in:
Francis Lavoie 2024-09-25 16:30:56 -04:00 committed by GitHub
parent 9dda8fbf84
commit 2faeac0a10
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 142 additions and 268 deletions

View file

@ -16,6 +16,7 @@ package caddyfile
import (
"fmt"
"slices"
)
type adjacency map[string][]string
@ -91,12 +92,7 @@ func (i *importGraph) areConnected(from, to string) bool {
if !ok {
return false
}
for _, v := range al {
if v == to {
return true
}
}
return false
return slices.Contains(al, to)
}
func (i *importGraph) willCycle(from, to string) bool {