This repository has been archived on 2026-01-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Game/Server/common/utils/number.go
2025-06-28 17:38:22 +08:00

14 lines
205 B
Go

package utils
import (
"math/rand"
)
// RandInt 生成 [min, max] 范围内的随机整数
func RandInt(min, max int) int {
if min > max {
min, max = max, min
}
return rand.Intn(max-min+1) + min
}