去掉在包里使用rand.seed
This commit is contained in:
parent
1b15aa494d
commit
cff45a3e86
|
@ -1,16 +1,12 @@
|
||||||
|
// Package number
|
||||||
|
// 使用随机数时需要先 调用 rand.seed()函数
|
||||||
package number
|
package number
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var _ = func() any {
|
|
||||||
rand.Seed(time.Now().UnixNano())
|
|
||||||
return nil
|
|
||||||
}()
|
|
||||||
|
|
||||||
type IntNumber interface {
|
type IntNumber interface {
|
||||||
~int | ~int64 | ~int32 | ~int8 | ~int16 |
|
~int | ~int64 | ~int32 | ~int8 | ~int16 |
|
||||||
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
|
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
|
||||||
|
|
Loading…
Reference in New Issue
Block a user