From cff45a3e8668abdc2861b034213fa62521f428ae Mon Sep 17 00:00:00 2001 From: xing Date: Wed, 1 Feb 2023 23:52:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=9C=A8=E5=8C=85=E9=87=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8rand.seed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helper/number/number.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/helper/number/number.go b/helper/number/number.go index 7198d30..9e55f0a 100644 --- a/helper/number/number.go +++ b/helper/number/number.go @@ -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