all: update exp/slices and fix call sites
slices.SortFunc suffered a late-in-cycle API breakage. Updates #cleanup Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
committed by
Dave Anderson
parent
90a7d3066c
commit
52212f4323
@@ -22,6 +22,7 @@ import (
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"go4.org/netipx"
|
||||
"golang.org/x/exp/slices"
|
||||
"tailscale.com/atomicfile"
|
||||
"tailscale.com/envknob"
|
||||
@@ -76,11 +77,11 @@ func MakeLookupFunc(logf logger.Logf, netMon *netmon.Monitor) func(ctx context.C
|
||||
metricRecursiveErrors.Add(1)
|
||||
return
|
||||
}
|
||||
slices.SortFunc(addrs, func(a, b netip.Addr) bool { return a.Less(b) })
|
||||
slices.SortFunc(addrs, netipx.CompareAddr)
|
||||
|
||||
// Wait for a response from the main function
|
||||
oldAddrs := <-addrsCh
|
||||
slices.SortFunc(oldAddrs, func(a, b netip.Addr) bool { return a.Less(b) })
|
||||
slices.SortFunc(oldAddrs, netipx.CompareAddr)
|
||||
|
||||
matches := slices.Equal(addrs, oldAddrs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user