From 61353d51e56656d659762285e6d694cd48a64397 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Mon, 11 Nov 2024 18:43:48 +0100 Subject: [PATCH] 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. --- smtp/smtp_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smtp/smtp_test.go b/smtp/smtp_test.go index 9011363..9ac6118 100644 --- a/smtp/smtp_test.go +++ b/smtp/smtp_test.go @@ -3692,7 +3692,7 @@ 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 { + if _, err := props.EchoBuffer.Write([]byte(data)); err != nil { t.Errorf("failed write to echo buffer: %s", err) } } @@ -3795,7 +3795,7 @@ func handleTestServerConnection(connection net.Conn, t *testing.T, props *server break } 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) } }