From 6ebc60d1df74e2fb764f6dec0221ee5152cb4f8a Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Fri, 22 Nov 2024 16:22:53 +0100 Subject: [PATCH] Remove redundant nil check for SMTP client The removed check for a nil SMTP client was redundant because the previous error handling already covers this case. Streamlining this part of the code improves readability and reduces unnecessary checks. --- client.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/client.go b/client.go index 98aea82..028e277 100644 --- a/client.go +++ b/client.go @@ -1017,9 +1017,6 @@ func (c *Client) DialToSMTPClientWithContext(ctxDial context.Context) (*smtp.Cli if err != nil { return nil, err } - if client == nil { - return nil, fmt.Errorf("SMTP client is nil") - } if c.logger != nil { client.SetLogger(c.logger)