From 21b5cf52df428ff31a3d134cbacc9f39f49d7f7d Mon Sep 17 00:00:00 2001 From: JIeJaitt <498938874@qq.com> Date: Wed, 12 Mar 2025 19:23:22 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Feature:=20Remove=20unnecessary?= =?UTF-8?q?=20session=20context=20edge=20case=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/session/middleware_test.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/middleware/session/middleware_test.go b/middleware/session/middleware_test.go index db0d9f33..b8c545c3 100644 --- a/middleware/session/middleware_test.go +++ b/middleware/session/middleware_test.go @@ -1,7 +1,6 @@ package session import ( - "context" "io" "net/http/httptest" "strings" @@ -501,16 +500,3 @@ func Test_Session_Context(t *testing.T) { require.NoError(t, err) require.Equal(t, "success", string(body)) } - -func Test_Session_GoContext_EdgeCases(t *testing.T) { - t.Parallel() - - // Test with nil context - sess := FromContext(nil) //nolint:staticcheck // Intentionally testing nil context behavior - require.Nil(t, sess, "Session should be nil with nil context") - - // Test with context that doesn't have a session - ctx := context.Background() - sess = FromContext(ctx) - require.Nil(t, sess, "Session should be nil when not in context") -}