feat: downgrade sendClientCommand()
from method to function
This commit is contained in:
parent
f19ab81dc8
commit
9656db5335
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue