去掉在包里使用rand.seed

This commit is contained in:
xing 2023-02-01 23:52:09 +08:00
parent 1b15aa494d
commit cff45a3e86

View File

@ -1,16 +1,12 @@
// Package number
// 使用随机数时需要先 调用 rand.seed()函数
package number
import (
"fmt"
"math/rand"
"time"
)
var _ = func() any {
rand.Seed(time.Now().UnixNano())
return nil
}()
type IntNumber interface {
~int | ~int64 | ~int32 | ~int8 | ~int16 |
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64