From 77920be1a116f9cb0810a581d50f2db699731e15 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Fri, 20 Sep 2024 20:39:50 +0200 Subject: [PATCH] Remove unnecessary error handling Eliminated redundant error handling for random number generation as errors from these functions do not require special attention. This reduces code complexity and improves readability. --- msg.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msg.go b/msg.go index 11d8ab1..b66bffe 100644 --- a/msg.go +++ b/msg.go @@ -467,8 +467,8 @@ func (m *Msg) SetMessageID() { if err != nil { hostname = "localhost.localdomain" } - randNumPrimary, _ := randNum(100000000) - randNumSecondary, _ := randNum(10000) + randNumPrimary := randNum(100000000) + randNumSecondary := randNum(10000) randString, _ := randomStringSecure(17) procID := os.Getpid() * randNumSecondary messageID := fmt.Sprintf("%d.%d%d.%s@%s", procID, randNumPrimary, randNumSecondary,