package buildin import ( "math/rand" "time" ) // RangeInt 按照指定范围生成随机数 func RangeInt(min, max uint) int { if min >= max { return int(min) } rand.Seed(time.Now().UnixNano()) return int(min + uint(rand.Intn(int(max-min+1)))) }