1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-08 05:47:07 +09:00

GO-3171: fix android build

Signed-off-by: AnastasiaShemyakinskaya <shem98a@mail.ru>
This commit is contained in:
AnastasiaShemyakinskaya 2024-06-11 15:00:27 +02:00
parent db2e10d80c
commit ddb2a033b6
No known key found for this signature in database
GPG key ID: CCD60ED83B103281
3 changed files with 10 additions and 5 deletions

2
go.sum
View file

@ -83,8 +83,6 @@ github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxB
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/andybalholm/cascadia v1.3.2 h1:3Xi6Dw5lHF15JtdcmAHD3i1+T8plmv7BQ/nsViSLyss=
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
github.com/anyproto/any-sync v0.4.21-0.20240528130317-a2b8442749bd h1:GG98tZg7TaGuYkr7TRGCy+jB+M/b0rm2LVIWaSilHYU=
github.com/anyproto/any-sync v0.4.21-0.20240528130317-a2b8442749bd/go.mod h1:sO/zUrmnCZKnH/3KaRH3JQSZMuINS3X7ZJa+d4YgfkA=
github.com/anyproto/any-sync v0.4.21-0.20240530210506-68c853f2ce95 h1:A8r04MCYpsBSWBSq4jy48+LIM/FvPx9NG9i4qfeGQS4=
github.com/anyproto/any-sync v0.4.21-0.20240530210506-68c853f2ce95/go.mod h1:sO/zUrmnCZKnH/3KaRH3JQSZMuINS3X7ZJa+d4YgfkA=
github.com/anyproto/badger/v4 v4.2.1-0.20240110160636-80743fa3d580 h1:Ba80IlCCxkZ9H1GF+7vFu/TSpPvbpDCxXJ5ogc4euYc=

View file

@ -5,8 +5,7 @@ package addrs
import (
"net"
"golang.org/x/exp/slices"
"slices"
"github.com/anyproto/anytype-heart/util/slice"
)

View file

@ -2,7 +2,9 @@ package localdiscovery
import (
"context"
"net"
gonet "net"
"slices"
"strings"
"sync"
@ -158,7 +160,13 @@ func (l *localDiscovery) notifyPeerToPeerStatus(newAddrs addrs.InterfacesAddrs)
}
func (l *localDiscovery) notifyP2PNotPossible(newAddrs addrs.InterfacesAddrs) bool {
return len(newAddrs.Interfaces) == 0 || addrs.IsLoopBack(newAddrs.Interfaces)
return len(newAddrs.Interfaces) == 0 || IsLoopBack(newAddrs.Interfaces)
}
func IsLoopBack(interfaces []net.Interface) bool {
return len(interfaces) == 1 && slices.ContainsFunc(interfaces, func(n net.Interface) bool {
return n.Flags&net.FlagLoopback != 0
})
}
func (l *localDiscovery) executeHook(hook Hook) {