diff --git a/cmd/chat-cli/api/client.go b/cmd/chat-cli/api/client.go index 2d1174f..95141b5 100644 --- a/cmd/chat-cli/api/client.go +++ b/cmd/chat-cli/api/client.go @@ -56,7 +56,7 @@ func (c *Client) do(method, path string, body any) ([]byte, error) { if err != nil { return nil, fmt.Errorf("http: %w", err) } - defer resp.Body.Close() + defer func() { _ = resp.Body.Close() }() data, err := io.ReadAll(resp.Body) if err != nil { @@ -141,7 +141,8 @@ func (c *Client) PollMessages(afterID string, timeout int) ([]Message, error) { if err != nil { return nil, err } - defer resp.Body.Close() + + defer func() { _ = resp.Body.Close() }() data, err := io.ReadAll(resp.Body) if err != nil { diff --git a/cmd/chat-cli/main.go b/cmd/chat-cli/main.go index d0db948..78268dd 100644 --- a/cmd/chat-cli/main.go +++ b/cmd/chat-cli/main.go @@ -440,7 +440,7 @@ func (a *App) cmdWindow(args string) { } n := 0 - fmt.Sscanf(args, "%d", &n) + _, _ = fmt.Sscanf(args, "%d", &n) a.ui.SwitchBuffer(n) a.mu.Lock() diff --git a/cmd/chat-cli/ui.go b/cmd/chat-cli/ui.go index aa8fafe..a1c5dac 100644 --- a/cmd/chat-cli/ui.go +++ b/cmd/chat-cli/ui.go @@ -131,7 +131,7 @@ func (ui *UI) AddLine(bufferName string, line string) { // If viewing this buffer, append to display. if ui.buffers[ui.currentBuffer] == buf { - fmt.Fprintln(ui.messages, line) + _, _ = fmt.Fprintln(ui.messages, line) } }) } @@ -156,7 +156,7 @@ func (ui *UI) SwitchBuffer(n int) { ui.messages.Clear() for _, line := range buf.Lines { - fmt.Fprintln(ui.messages, line) + _, _ = fmt.Fprintln(ui.messages, line) } ui.messages.ScrollToEnd() @@ -181,7 +181,7 @@ func (ui *UI) SwitchToBuffer(name string) { ui.messages.Clear() for _, line := range buf.Lines { - fmt.Fprintln(ui.messages, line) + _, _ = fmt.Fprintln(ui.messages, line) } ui.messages.ScrollToEnd() @@ -218,7 +218,7 @@ func (ui *UI) refreshStatusWith(nick, target, connStatus string) { bufInfo := fmt.Sprintf("[%d:%s]", ui.currentBuffer, ui.buffers[ui.currentBuffer].Name) ui.statusBar.Clear() - fmt.Fprintf(ui.statusBar, " [%s] %s %s %s%s", + _, _ = fmt.Fprintf(ui.statusBar, " [%s] %s %s %s%s", connStatus, nick, bufInfo, target, unread) }