mirror of
https://github.com/prometheus/prometheus.git
synced 2025-09-21 05:41:01 +02:00
refactor: use slices.Equal to simplify code
Signed-off-by: MarkDaveny <peicuiping@aliyun.com>
This commit is contained in:
parent
7a7bc65237
commit
53be282396
@ -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…
x
Reference in New Issue
Block a user