Explicitly ignore errors in WS handlers

This commit is contained in:
Ryan Smith
2025-04-05 14:27:00 -07:00
parent ecbe1d4972
commit 0462ed7b4c
2 changed files with 4 additions and 4 deletions

View File

@@ -59,7 +59,7 @@ func handleWebSocket(ws *websocket.Conn) {
muWSClients.Lock()
delete(wsClients, ws)
muWSClients.Unlock()
ws.Close()
_ = ws.Close()
}()
// Enforce private IPs.
@@ -79,11 +79,11 @@ func handleWebSocket(ws *websocket.Conn) {
// Send the cache of recent log messages to the new client.
for _, msg := range wsRecentMessages {
websocket.Message.Send(ws, msg)
_ = websocket.Message.Send(ws, msg)
}
// Send a message informing the client that we're done sending the initial
// cache of log messages.
websocket.Message.Send(ws, "---end---")
_ = websocket.Message.Send(ws, "---end---")
// Keep WebSocket open.
var message string

View File

@@ -304,7 +304,7 @@ func handleCSS(w http.ResponseWriter, r *http.Request) {
fmt.Println(err)
return
}
w.Write(data)
_, _ = w.Write(data)
}
// handleConfig serves a page that displays the Deceptifeed configuration.