mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-06-07 08:46:41 +00:00
- Update github.com/sirupsen/logrus v1.9.0 -> v1.9.3 in test/go.mod to fix GHSA-4f99-4q7p-p3gh (High) - Update github.com/prometheus/prometheus v0.35.0 -> v0.311.3 to fix GHSA-vffh-x6r8-xx99 (Medium) - Run go mod tidy and go mod vendor to update vendor directory
24 lines
630 B
Go
24 lines
630 B
Go
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package stringutils
|
|
|
|
import (
|
|
"slices"
|
|
"strings"
|
|
)
|
|
|
|
// ContainsStrings searches a slice of strings for a case-sensitive match
|
|
//
|
|
// Now equivalent to the standard library [slice.Contains].
|
|
func ContainsStrings(coll []string, item string) bool {
|
|
return slices.Contains(coll, item)
|
|
}
|
|
|
|
// ContainsStringsCI searches a slice of strings for a case-insensitive match
|
|
func ContainsStringsCI(coll []string, item string) bool {
|
|
return slices.ContainsFunc(coll, func(e string) bool {
|
|
return strings.EqualFold(e, item)
|
|
})
|
|
}
|