From 2de56556d919c27c30052d2e1e4b29a743de50d8 Mon Sep 17 00:00:00 2001 From: fatedier Date: Sun, 8 Mar 2026 18:19:12 +0800 Subject: [PATCH] server/group: replace tautological assertion with require.NotPanics --- server/group/registry_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/group/registry_test.go b/server/group/registry_test.go index 329edba2..106d3998 100644 --- a/server/group/registry_test.go +++ b/server/group/registry_test.go @@ -95,7 +95,8 @@ func TestConcurrentGetOrCreateAndRemoveIf(t *testing.T) { } wg.Wait() - // After all goroutines finish, the key either exists or not — no panic or race. - _, ok := r.get("k") - require.True(t, ok || !ok) // just verifying no panic + // After all goroutines finish, accessing the key must not panic. + require.NotPanics(t, func() { + _, _ = r.get("k") + }) }