From 0db1383940742f847d6c23b7c9fd04787cad059b Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Wed, 23 Oct 2024 17:58:08 +0200 Subject: [PATCH] Refactor buffer initialization in client tests Replaced &bytes.Buffer{} with bytes.NewBuffer(nil) for buffer initialization in various client tests. This change ensures more idiomatic and consistent creation of byte buffers throughout the test cases. --- client_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client_test.go b/client_test.go index e288262..c009acf 100644 --- a/client_test.go +++ b/client_test.go @@ -1135,7 +1135,7 @@ func TestClient_SetDebugLog(t *testing.T) { if err != nil { t.Fatalf("failed to create new client: %s", err) } - buffer := &bytes.Buffer{} + buffer := bytes.NewBuffer(nil) client.SetLogger(log.New(buffer, log.LevelDebug)) client.SetDebugLog(true) @@ -1164,7 +1164,7 @@ func TestClient_SetDebugLog(t *testing.T) { if err != nil { t.Fatalf("failed to create new client: %s", err) } - buffer := &bytes.Buffer{} + buffer := bytes.NewBuffer(nil) client.SetLogger(log.New(buffer, log.LevelDebug)) client.SetDebugLog(false) @@ -1202,7 +1202,7 @@ func TestClient_SetDebugLog(t *testing.T) { } }) - buffer := &bytes.Buffer{} + buffer := bytes.NewBuffer(nil) client.SetLogger(log.New(buffer, log.LevelDebug)) client.SetDebugLog(true) if err = client.smtpClient.Noop(); err != nil {