From 9f1e1976fe210347adbf8a291a1f8f0cb22c5043 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Thu, 24 Oct 2024 14:49:24 +0200 Subject: [PATCH] Fix assignment in error handling for EML parsing function Correct the variable assignment in the `if err` statement to ensure proper error handling. This change eliminates a potential bug where the wrong variable might be used. --- eml.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eml.go b/eml.go index e150068..61a7151 100644 --- a/eml.go +++ b/eml.go @@ -93,7 +93,7 @@ func EMLToMsgFromFile(filePath string) (*Msg, error) { return msg, fmt.Errorf("failed to parse EML file: %w", err) } - if err := parseEML(parsedMsg, bodybuf, msg); err != nil { + if err = parseEML(parsedMsg, bodybuf, msg); err != nil { return msg, fmt.Errorf("failed to parse EML contents: %w", err) }