Skip to content

Commit

Permalink
fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
geovex committed Aug 21, 2024
1 parent bf32281 commit 75ff399
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/network_exchange/dc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 75ff399

Please sign in to comment.