Skip to content

Commit cf466a3

Browse files
committed
lint: dnsx/resolver
1 parent 5a56584 commit cf466a3

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

intra/dnsx/transport.go

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"fmt"
1414
"io"
1515
"net/netip"
16+
"slices"
1617
"strings"
1718
"sync"
1819
"sync/atomic"
@@ -1221,12 +1222,7 @@ func canUseDefaultDNS(id string) bool {
12211222
}
12221223

12231224
func isTransportID(match string, ids ...string) bool {
1224-
for _, t := range ids {
1225-
if t == match {
1226-
return true
1227-
}
1228-
}
1229-
return false
1225+
return slices.Contains(ids, match)
12301226
}
12311227

12321228
func isAnyBlockAll(ids ...string) bool {
@@ -1251,12 +1247,7 @@ func isAnyLocal(ids ...string) bool {
12511247
}
12521248

12531249
func isAnyPlus(ids ...string) bool {
1254-
for _, id := range ids {
1255-
if isPlus(id) {
1256-
return true
1257-
}
1258-
}
1259-
return false
1250+
return slices.ContainsFunc(ids, isPlus)
12601251
}
12611252

12621253
func isAnyDefault(ids ...string) bool {

0 commit comments

Comments
 (0)