From 6619dc803e2eb1a61c7105e99a678e07a308be9b Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 20 Oct 2025 15:12:14 +0000 Subject: [PATCH] refactor: use strconv.Itoa instead of string(rune()) in test Replace string(rune(i)) with strconv.Itoa(i) in hub_concurrency_test.go for generating client IDs. While this is test code and not a production bug, it uses the same incorrect pattern that caused the PR #575 bug. This ensures consistent best practices across the codebase and avoids confusion for developers who might copy this pattern. Related: #575 --- internal/websocket/hub_concurrency_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/websocket/hub_concurrency_test.go b/internal/websocket/hub_concurrency_test.go index ecc6a52..6db9570 100644 --- a/internal/websocket/hub_concurrency_test.go +++ b/internal/websocket/hub_concurrency_test.go @@ -1,6 +1,7 @@ package websocket import ( + "strconv" "sync" "testing" "time" @@ -24,7 +25,7 @@ func TestHubConcurrentClients(t *testing.T) { client := &Client{ hub: hub, send: make(chan []byte, 10), - id: "client-register-" + string(rune(i)), + id: "client-register-" + strconv.Itoa(i), } hub.register <- client time.Sleep(time.Microsecond)