From a61da7d2802b93af86ab2c32dcd7ebb1e0bc4352 Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Wed, 23 Oct 2024 13:18:33 +0200 Subject: [PATCH] chore: reorder parameters in SendCmd function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 --- cmd/client/main.go | 10 +++++----- internal/websocket/send.go | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/client/main.go b/cmd/client/main.go index e1443e1..abf14ba 100644 --- a/cmd/client/main.go +++ b/cmd/client/main.go @@ -25,7 +25,7 @@ func Start() { websocket.Send_updateSettings(conn, *password) if *autoStart { - websocket.SendCmd(conn, "start", *password) + websocket.SendCmd(conn, *password, "start") } go websocket.ProcessServerMessages(conn) @@ -34,18 +34,18 @@ func Start() { switch key.String() { case "space": if !shared.ServerMessage.Ongoing { - websocket.SendCmd(conn, "start", *password) + websocket.SendCmd(conn, *password, "start") return false, nil } if shared.ServerMessage.Paused { - websocket.SendCmd(conn, "resume", *password) + websocket.SendCmd(conn, *password, "resume") return false, nil } else { - websocket.SendCmd(conn, "pause", *password) + websocket.SendCmd(conn, *password, "pause") return false, nil } case "r": - websocket.SendCmd(conn, "stop", *password) + websocket.SendCmd(conn, *password, "stop") return false, nil case "q": interrupt <- os.Interrupt diff --git a/internal/websocket/send.go b/internal/websocket/send.go index c2971d4..df11a4b 100644 --- a/internal/websocket/send.go +++ b/internal/websocket/send.go @@ -23,7 +23,7 @@ func sendClientCommand(conn *websocket.Conn, msg models.ClientCommand) { } } -func SendCmd(conn *websocket.Conn, cmd string, pwd string) { +func SendCmd(conn *websocket.Conn, pwd string, cmd string) { message := models.ClientCommand{ Command: cmd, Password: pwd,