From d2d81add0df7f0198fa919da54b2c552d5531de7 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 17 Jan 2025 11:15:44 +0800 Subject: [PATCH] refactor: refactor codebase to improve performance and maintainability - Remove redundant variable redeclaration of `cookies` in `TestRediStore` function Signed-off-by: Bo-Yi Wu --- redistore_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/redistore_test.go b/redistore_test.go index ec9c622..ba62168 100644 --- a/redistore_test.go +++ b/redistore_test.go @@ -192,7 +192,7 @@ func TestRediStore(t *testing.T) { t.Fatalf("Error saving session: %v", err) } hdr := rsp.Header() - cookies, ok := hdr["Set-Cookie"] + cookies, ok = hdr["Set-Cookie"] if !ok || len(cookies) != 1 { t.Fatalf("No cookies. Header: %s", hdr) } @@ -279,7 +279,7 @@ func TestRediStore(t *testing.T) { t.Fatalf("Error saving session: %v", err) } hdr := rsp.Header() - cookies, ok := hdr["Set-Cookie"] + cookies, ok = hdr["Set-Cookie"] if !ok || len(cookies) != 1 { t.Fatalf("No cookies. Header: %s", hdr) } @@ -322,7 +322,7 @@ func TestRediStore(t *testing.T) { t.Fatalf("Error saving session: %v", err) } hdr := rsp.Header() - cookies, ok := hdr["Set-Cookie"] + cookies, ok = hdr["Set-Cookie"] if !ok || len(cookies) != 1 { t.Fatalf("No cookies. Header: %s", hdr) }