@ -4,6 +4,7 @@
package ipnlocal
package ipnlocal
import (
import (
"cmp"
"context"
"context"
"encoding/base64"
"encoding/base64"
"encoding/json"
"encoding/json"
@ -1332,7 +1333,7 @@ func (b *LocalBackend) UpdateNetmapDelta(muts []netmap.NodeMutation) (handled bo
nm . Peers = append ( nm . Peers , p )
nm . Peers = append ( nm . Peers , p )
}
}
slices . SortFunc ( nm . Peers , func ( a , b tailcfg . NodeView ) int {
slices . SortFunc ( nm . Peers , func ( a , b tailcfg . NodeView ) int {
return cmp x . Compare ( a . ID ( ) , b . ID ( ) )
return cmp . Compare ( a . ID ( ) , b . ID ( ) )
} )
} )
notify = & ipn . Notify { NetMap : nm }
notify = & ipn . Notify { NetMap : nm }
} else if testenv . InTest ( ) {
} else if testenv . InTest ( ) {
@ -1549,7 +1550,7 @@ func (b *LocalBackend) PeersForTest() []tailcfg.NodeView {
defer b . mu . Unlock ( )
defer b . mu . Unlock ( )
ret := xmaps . Values ( b . peers )
ret := xmaps . Values ( b . peers )
slices . SortFunc ( ret , func ( a , b tailcfg . NodeView ) int {
slices . SortFunc ( ret , func ( a , b tailcfg . NodeView ) int {
return cmp x . Compare ( a . ID ( ) , b . ID ( ) )
return cmp . Compare ( a . ID ( ) , b . ID ( ) )
} )
} )
return ret
return ret
}
}
@ -4904,7 +4905,7 @@ func (b *LocalBackend) FileTargets() ([]*apitype.FileTarget, error) {
} )
} )
}
}
slices . SortFunc ( ret , func ( a , b * apitype . FileTarget ) int {
slices . SortFunc ( ret , func ( a , b * apitype . FileTarget ) int {
return cmp x . Compare ( a . Node . Name , b . Node . Name )
return cmp . Compare ( a . Node . Name , b . Node . Name )
} )
} )
return ret , nil
return ret , nil
}
}