renovate the code, update to go 1.26 and satisfy linter (#3)

This commit is contained in:
T. von Dein
2026-08-22 17:59:59 +02:00
parent 9cd6e4a6b9
commit 6d9763a0a9
77 changed files with 681 additions and 227 deletions

View File

@@ -5,8 +5,9 @@ import (
"fmt"
)
// GetWorkspaces returns a list of Nodes of type NodeTypeWorkspace
func (ipc *SwayIPC) GetWorkspaces() ([]*Node, error) {
payload, err := ipc.get(GET_WORKSPACES)
payload, err := ipc.get(MsgGetWorkspaces)
if err != nil {
return nil, err
}
@@ -19,8 +20,9 @@ func (ipc *SwayIPC) GetWorkspaces() ([]*Node, error) {
return nodes, nil
}
// GetMarks returns a list of marks
func (ipc *SwayIPC) GetMarks() ([]string, error) {
payload, err := ipc.get(GET_MARKS)
payload, err := ipc.get(MsgGetMarks)
if err != nil {
return nil, err
}
@@ -33,8 +35,9 @@ func (ipc *SwayIPC) GetMarks() ([]string, error) {
return marks, nil
}
// GetBindingModes returns a list of binding modes
func (ipc *SwayIPC) GetBindingModes() ([]string, error) {
payload, err := ipc.get(GET_BINDING_MODES)
payload, err := ipc.get(MsgGetBindingModes)
if err != nil {
return nil, err
}
@@ -47,8 +50,9 @@ func (ipc *SwayIPC) GetBindingModes() ([]string, error) {
return modes, nil
}
// GetBindingState returns a list of binding states
func (ipc *SwayIPC) GetBindingState() (*State, error) {
payload, err := ipc.get(GET_BINDING_STATE)
payload, err := ipc.get(MsgGetBindingState)
if err != nil {
return nil, err
}
@@ -61,8 +65,9 @@ func (ipc *SwayIPC) GetBindingState() (*State, error) {
return state, nil
}
// GetConfig return user wm config
func (ipc *SwayIPC) GetConfig() (string, error) {
payload, err := ipc.get(GET_CONFIG)
payload, err := ipc.get(MsgGetConfig)
if err != nil {
return "", err
}
@@ -75,8 +80,9 @@ func (ipc *SwayIPC) GetConfig() (string, error) {
return config.Config, nil
}
// SendTick sends a tick
func (ipc *SwayIPC) SendTick(payload string) error {
err := ipc.sendHeader(SEND_TICK, uint32(len(payload)))
err := ipc.sendHeader(MsgSendTick, uint32(len(payload)))
if err != nil {
return err
}