mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-04-28 03:20:11 +00:00
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
This commit is contained in:
parent
8d6346a008
commit
6619dc803e
1 changed files with 2 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue