mirror of
https://github.com/prometheus/prometheus.git
synced 2026-05-28 04:02:21 -04:00
refactor: use slices.Equal to simplify code
Signed-off-by: MarkDaveny <peicuiping@aliyun.com>
This commit is contained in:
parent
7a7bc65237
commit
53be282396
1 changed files with 2 additions and 6 deletions
|
|
@ -23,6 +23,7 @@ import (
|
|||
"net/http/httptest"
|
||||
"net/url"
|
||||
"os"
|
||||
"slices"
|
||||
"sort"
|
||||
"strconv"
|
||||
"sync"
|
||||
|
|
@ -1156,12 +1157,7 @@ func requireTargets(
|
|||
}
|
||||
sort.Strings(expectedTargets)
|
||||
sort.Strings(sTargets)
|
||||
for i, t := range sTargets {
|
||||
if t != expectedTargets[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
return slices.Equal(sTargets, expectedTargets)
|
||||
}, 1*time.Second, 100*time.Millisecond)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue