diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-08-16 22:46:42 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-08-16 22:46:42 +0200 |
commit | ccbbb2049a7f3d09f8f336fe3b3c1c0f050b40f3 (patch) | |
tree | 6a5b8195204e5a29f192871fe969e1ada4b2847e | |
parent | 116f6094a719bc30d251f373e9e096f66cf8e9b6 (diff) |
Use rand/v2
-rw-r--r-- | lib/email/email.go | 5 |
1 files changed, 2 insertions, 3 deletions
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) |