build: modernize with "go fix -slicescontains": use slices.Contains

This commit is contained in:
Nick Craig-Wood
2026-08-21 12:23:31 +01:00
parent 237719bb8d
commit 9f9fd82923
3 changed files with 8 additions and 14 deletions
+2 -6
View File
@@ -4,6 +4,7 @@ package api
import (
"encoding/xml"
"regexp"
"slices"
"strconv"
"strings"
"sync"
@@ -107,12 +108,7 @@ func (p *Prop) StatusOK() bool {
if len(p.Status) == 0 {
return true
}
for _, statusStr := range p.Status {
if parseStatus2XX.MatchString(statusStr) {
return true
}
}
return false
return slices.ContainsFunc(p.Status, parseStatus2XX.MatchString)
}
// Hashes returns a map of all checksums - may be nil