Refactor error variable in smtp test

Renamed 'err' to 'berr' to avoid shadowing outer variable. This change ensures clearer error handling and avoids potential issues with variable scope and readability in the smtp_test.go file.
This commit is contained in:
Winni Neessen 2024-11-11 19:21:50 +01:00
parent 77175a2952
commit f7bdd8fffc
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -3665,8 +3665,8 @@ func handleTestServerConnection(connection net.Conn, t *testing.T, props *server
}
time.Sleep(time.Millisecond)
if props.EchoBuffer != nil {
if _, err := props.EchoBuffer.Write([]byte(data)); err != nil {
t.Errorf("failed write to echo buffer: %s", err)
if _, berr := props.EchoBuffer.Write([]byte(data)); berr != nil {
t.Errorf("failed write to echo buffer: %s", berr)
}
}