From 9656db53359e3621b3b6ec9b20df9de8a0ae0607 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Wed, 30 Oct 2024 19:29:40 +0100 Subject: [PATCH] feat: downgrade `sendClientCommand()` from method to function --- internal/websocket/send.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/websocket/send.go b/internal/websocket/send.go index 8bc905a..c3871b0 100644 --- a/internal/websocket/send.go +++ b/internal/websocket/send.go @@ -8,8 +8,8 @@ import ( GoTomato "git.smsvc.net/pomodoro/GoTomato/pkg/models" ) -// Sends to ClientCommand to the clients websocket -func (c Client) sendClientCommand(msg GoTomato.ClientCommand) { +// Sends a message to the clients websocket +func sendClientCommand(c Client, msg GoTomato.ClientCommand) { messageBytes, err := json.Marshal(msg) if err != nil { log.Error("Error marshalling!", "reason", err) @@ -30,7 +30,7 @@ func (c Client) SendCmd(cmd string) { Password: c.Password, } - c.sendClientCommand(message) + sendClientCommand(c, message) } // Sends the new PomodoroConfig to the server @@ -41,5 +41,5 @@ func (c Client) SendSettingsUpdate(settings GoTomato.PomodoroConfig) { Settings: settings, } - c.sendClientCommand(message) + sendClientCommand(c, message) }