Refactor code and fix linter warnings (#3627)

* refactor: use any instead of empty interface

* refactor: code cleanup
This commit is contained in:
Ilya Kryuchkov
2026-01-05 07:54:56 +03:00
committed by GitHub
parent 4800f8fb70
commit 6041d10e3d
16 changed files with 61 additions and 47 deletions
+3 -3
View File
@@ -26,7 +26,7 @@ const (
// Message represents a WebSocket message
type Message struct {
Type MessageType `json:"type"`
Payload interface{} `json:"payload"`
Payload any `json:"payload"`
Time int64 `json:"time"`
}
@@ -250,7 +250,7 @@ func (h *Hub) broadcastParallel(clients []*Client, message []byte) {
}
// Broadcast sends a message to all connected clients
func (h *Hub) Broadcast(messageType MessageType, payload interface{}) {
func (h *Hub) Broadcast(messageType MessageType, payload any) {
if h == nil {
return
}
@@ -289,7 +289,7 @@ func (h *Hub) Broadcast(messageType MessageType, payload interface{}) {
}
// BroadcastToTopic sends a message only to clients subscribed to the specific topic
func (h *Hub) BroadcastToTopic(messageType MessageType, payload interface{}) {
func (h *Hub) BroadcastToTopic(messageType MessageType, payload any) {
if h == nil {
return
}