From 75ff39944d03df3b9aa0e7312eae4f8ceab18616 Mon Sep 17 00:00:00 2001 From: Heorhi Valakhanovich Date: Wed, 21 Aug 2024 18:31:48 +0300 Subject: [PATCH] fix compilation --- internal/network_exchange/dc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/network_exchange/dc.go b/internal/network_exchange/dc.go index 9bf5f57..5cdfd0e 100644 --- a/internal/network_exchange/dc.go +++ b/internal/network_exchange/dc.go @@ -3,11 +3,11 @@ package network_exchange import ( "fmt" "io" + "math/rand" "net" "github.com/geovex/tgp/internal/maplist" "github.com/geovex/tgp/internal/tgcrypt_encryption" - "golang.org/x/exp/rand" "golang.org/x/net/proxy" ) @@ -40,7 +40,7 @@ func getDcAddr(dc int16) (ipv4, ipv6 string, err error) { if dc < 1 || dc > dcMaxIdx { //return "", "", fmt.Errorf("invalid dc number %d", dc) //instead return random dc - dc = rand.Intn(dcMaxIdx) + 1 + dc = int16(rand.Intn(int(dcMaxIdx)) + 1) } ipv4, _ = dc_ip4.GetRandom(dc) ipv6, _ = dc_ip6.GetRandom(dc)