From ccbbb2049a7f3d09f8f336fe3b3c1c0f050b40f3 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Fri, 16 Aug 2024 22:46:42 +0200 Subject: Use rand/v2 --- lib/email/email.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/email/email.go b/lib/email/email.go index f6d6673..16ba492 100644 --- a/lib/email/email.go +++ b/lib/email/email.go @@ -3,7 +3,7 @@ package email import ( "crypto/tls" "fmt" - "math/rand" + "math/rand/v2" "net/smtp" "strconv" "time" @@ -27,8 +27,7 @@ Message-ID: <%s> %s` func ServerError(fault error) error { - r := rand.New(rand.NewSource(time.Now().UnixNano())) - msgid := strconv.FormatInt(r.Int63(), 10) + "@" + Config.Host + msgid := strconv.FormatInt(rand.Int64(), 10) + "@" + Config.Host msg := fmt.Sprintf(emailTemplate, Config.FromAddr, Config.ToAddr, "Error Report", time.Now().Format(time.RFC1123Z), msgid, fault) -- cgit v1.2.3