Rename variable 'failed' to 'hasError' for clarity

Renamed the variable 'failed' to 'hasError' to better reflect its purpose and improve code readability. This change helps in understanding that the variable indicates the presence of an error rather than a generic failure.
This commit is contained in:
Winni Neessen 2024-09-19 10:35:32 +02:00
parent 8ee37abca2
commit 2e7156182a
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -65,7 +65,7 @@ func (c *Client) sendSingleMsg(message *Msg) error {
}
return retError
}
failed := false
hasError := false
rcptSendErr := &SendError{}
rcptSendErr.errlist = make([]error, 0)
rcptSendErr.rcpt = make([]string, 0)
@ -77,10 +77,10 @@ func (c *Client) sendSingleMsg(message *Msg) error {
rcptSendErr.errlist = append(rcptSendErr.errlist, err)
rcptSendErr.rcpt = append(rcptSendErr.rcpt, rcpt)
rcptSendErr.isTemp = isTempError(err)
failed = true
hasError = true
}
}
if failed {
if hasError {
if resetSendErr := c.smtpClient.Reset(); resetSendErr != nil {
rcptSendErr.errlist = append(rcptSendErr.errlist, resetSendErr)
}