diff options
| author | Ilya Kryuchkov <42733472+kr-ilya@users.noreply.github.com> | 2026-01-05 07:54:56 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-05 07:54:56 +0300 |
| commit | 6041d10e3d5d8b0021dd596bdee8f0064a495f80 (patch) | |
| tree | 897ac55d8389dfea859e6071d08c56f97e843a09 /web/websocket/hub.go | |
| parent | 4800f8fb706a092a38255ee70904227238b2a6f6 (diff) | |
Refactor code and fix linter warnings (#3627)
* refactor: use any instead of empty interface
* refactor: code cleanup
Diffstat (limited to 'web/websocket/hub.go')
| -rw-r--r-- | web/websocket/hub.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/web/websocket/hub.go b/web/websocket/hub.go index 7ee93405..8aa5903c 100644 --- a/web/websocket/hub.go +++ b/web/websocket/hub.go @@ -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 } |
