Compare commits

...

2 Commits

Author SHA1 Message Date
lzf 4d51d0a1d0 update 2025-03-31 15:25:24 +08:00
lzf b876f0bfa3 update 2025-03-31 15:24:36 +08:00
1 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import (
"errors" "errors"
"git.makemake.in/kzkzzzz/mycommon/mylog" "git.makemake.in/kzkzzzz/mycommon/mylog"
"log" "log"
"math/rand/v2"
"net" "net"
"os" "os"
"runtime/debug" "runtime/debug"
@ -26,6 +27,11 @@ func SafeGo(fn func()) {
}() }()
} }
// RandRange [min, max] 左右均包含
func RandRange(min, max int) int {
return rand.IntN(max+1-min) + min
}
var ( var (
getIpOnce = &sync.Once{} getIpOnce = &sync.Once{}
outBoundIp = "127.0.0.1" outBoundIp = "127.0.0.1"