use strings.SplitSeq where possible

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2025-09-08 18:14:37 +02:00
parent 4e3e9bfb70
commit b97525a78d
21 changed files with 23 additions and 33 deletions

View File

@@ -96,7 +96,7 @@ func addPathToRegistry(dir string) error {
}
// Is this directory already on the windows path?
for _, element := range strings.Split(existing, ";") {
for element := range strings.SplitSeq(existing, ";") {
if strings.EqualFold(element, dir) {
// Path already added
return nil
@@ -147,7 +147,7 @@ func removePathFromRegistry(path string) error {
// No point preallocating we can't know how big the array needs to be.
//nolint:prealloc
var elements []string
for _, element := range strings.Split(existing, ";") {
for element := range strings.SplitSeq(existing, ";") {
if strings.EqualFold(element, path) {
continue
}