MCPcopy
hub / github.com/XIU2/CloudflareSpeedTest / randIPEndWith

Function randIPEndWith

task/ip.go:32–37  ·  view source on GitHub ↗
(num byte)

Source from the content-addressed store, hash-verified

30}
31
32func randIPEndWith(num byte) byte {
33 if num == 0 { // 对于 /32 这种单独的 IP
34 return byte(0)
35 }
36 return byte(rand.Intn(int(num)))
37}
38
39type IPRanges struct {
40 ips []*net.IPAddr

Callers 2

chooseIPv4Method · 0.85
chooseIPv6Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected