Skip to content

Commit

Permalink
Fix variable declarations in test cases
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wneessen committed Nov 11, 2024
1 parent 1d19290 commit 61353d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions smtp/smtp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 61353d5

Please sign in to comment.