mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 19:39:35 +03:00
Style: format code by gofumpt (#761)
This commit is contained in:
@ -79,13 +79,13 @@ func (fkdns *Holder) GetFakeIPForDomain(domain string) []net.Address {
|
||||
if v, ok := fkdns.domainToIP.Get(domain); ok {
|
||||
return []net.Address{v.(net.Address)}
|
||||
}
|
||||
var currentTimeMillis = uint64(time.Now().UnixNano() / 1e6)
|
||||
currentTimeMillis := uint64(time.Now().UnixNano() / 1e6)
|
||||
ones, bits := fkdns.ipRange.Mask.Size()
|
||||
rooms := bits - ones
|
||||
if rooms < 64 {
|
||||
currentTimeMillis %= (uint64(1) << rooms)
|
||||
}
|
||||
var bigIntIP = big.NewInt(0).SetBytes(fkdns.ipRange.IP)
|
||||
bigIntIP := big.NewInt(0).SetBytes(fkdns.ipRange.IP)
|
||||
bigIntIP = bigIntIP.Add(bigIntIP, new(big.Int).SetUint64(currentTimeMillis))
|
||||
var ip net.Address
|
||||
for {
|
||||
|
@ -11,9 +11,7 @@ import (
|
||||
"github.com/xtls/xray-core/features/dns"
|
||||
)
|
||||
|
||||
var (
|
||||
ipPrefix = "198.18."
|
||||
)
|
||||
var ipPrefix = "198.18."
|
||||
|
||||
func TestNewFakeDnsHolder(_ *testing.T) {
|
||||
_, err := NewFakeDNSHolder()
|
||||
|
Reference in New Issue
Block a user