Replaced stringArrayContains by slices.Contains

This commit is contained in:
Holger Obermaier
2026-02-06 13:49:39 +01:00
parent 1f7b13349c
commit 2b5bf4d6a5
13 changed files with 45 additions and 48 deletions

View File

@@ -51,18 +51,6 @@ func (c *metricCollector) Initialized() bool {
return c.init
}
// stringArrayContains scans an array of strings if the value str is present in the array
// If the specified value is found, the corresponding array index is returned.
// The bool value is used to signal success or failure
func stringArrayContains(array []string, str string) (int, bool) {
for i, a := range array {
if a == str {
return i, true
}
}
return -1, false
}
// RemoveFromStringList removes the string r from the array of strings s
// If r is not contained in the array an error is returned
func RemoveFromStringList(s []string, r string) ([]string, error) {