From fc6687f921699cd114efbd2ca60a7a7eed7732c5 Mon Sep 17 00:00:00 2001 From: t_max <1172915550@qq.com> Date: Fri, 22 Nov 2024 12:42:11 +0800 Subject: [PATCH] test: compatible with go version 1.17 --- tools/melody/melody_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/melody/melody_test.go b/tools/melody/melody_test.go index b6d9f05..53c8cce 100644 --- a/tools/melody/melody_test.go +++ b/tools/melody/melody_test.go @@ -559,9 +559,9 @@ func TestConcurrentMessageHandling(t *testing.T) { ws.m.Config.PingPeriod = base / 2 ws.m.Config.PongWait = base - var errorSet atomic.Bool + var errorSet uint32 ws.m.HandleError(func(s *Session, err error) { - errorSet.Store(true) + atomic.StoreUint32(&errorSet, 1) done <- struct{}{} }) @@ -586,7 +586,7 @@ func TestConcurrentMessageHandling(t *testing.T) { <-done - return errorSet.Load() + return atomic.LoadUint32(&errorSet) != 0 } t.Run("text should error", func(t *testing.T) {