去掉在包里使用rand.seed
This commit is contained in:
parent
1b15aa494d
commit
cff45a3e86
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user