Fix variable declarations in test cases

Changed variable declarations from '=' to ':=' to properly handle errors within the SMTP test cases. This ensures that errors are correctly captured and reported when writing to the EchoBuffer.
This commit is contained in:
Winni Neessen 2024-11-11 18:43:48 +01:00
parent 1d19290e1c
commit 61353d51e5
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

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