Fix default golanglint-ci errors

These errors show up when simply running `golangci-lint run ./...` on the project.
This commit is contained in:
Matthias Loibl
2025-01-17 17:59:30 +01:00
parent 02b6c413f1
commit ccebcb869f
6 changed files with 14 additions and 10 deletions

View File

@@ -1,7 +1,6 @@
package websocket
import (
"context"
"encoding/json"
"log/slog"
@@ -21,7 +20,7 @@ type ChanMsg struct {
Raw []byte
}
func ListenWebsocket(conn *websocket.Conn, ctx context.Context, c chan ChanMsg) {
func ListenWebsocket(conn *websocket.Conn, c chan ChanMsg) {
for {
bytes, err := ReadMessage(conn)
if err != nil {
@@ -34,7 +33,7 @@ func ListenWebsocket(conn *websocket.Conn, ctx context.Context, c chan ChanMsg)
// default to true for messages that don't include "success" at all
Success: true,
}
json.Unmarshal(bytes, &base)
_ = json.Unmarshal(bytes, &base)
if !base.Success {
slog.Warn("Received unsuccessful response", "response", string(bytes))
}