From d74c24339e11b7d96ab95b9c2707a567ac2459cd Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Sat, 9 May 2026 14:24:33 +0000 Subject: [PATCH] =?UTF-8?q?lint:=20finish=20errcheck=20=E2=80=94=20zero=20?= =?UTF-8?q?remaining?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix final cW calls in middleware/recoverer.go and sendTextCommandResponse in platform/text/text.go. --- middleware/recoverer.go | 30 +++++++++++++++--------------- platform/text/text.go | 4 +++- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/middleware/recoverer.go b/middleware/recoverer.go index ae2c2f02..5a1e609d 100644 --- a/middleware/recoverer.go +++ b/middleware/recoverer.go @@ -77,10 +77,10 @@ func (s prettyStack) parse(debugStack []byte, rvr interface{}) ([]byte, error) { useColor := true buf := &bytes.Buffer{} - cW(buf, false, bRed, "\n") - cW(buf, useColor, bCyan, " panic: ") - cW(buf, useColor, bBlue, "%v", rvr) - cW(buf, false, bWhite, "\n \n") + _ = cW(buf, false, bRed, "\n") + _ = cW(buf, useColor, bCyan, " panic: ") + _ = cW(buf, useColor, bBlue, "%v", rvr) + _ = cW(buf, false, bWhite, "\n \n") // process debug stack info stack := strings.Split(string(debugStack), "\n") @@ -157,14 +157,14 @@ func (s prettyStack) decorateFuncCallLine(line string, useColor bool, num int) ( methodColor := bGreen if num == 0 { - cW(buf, useColor, bRed, " -> ") + _ = cW(buf, useColor, bRed, " -> ") pkgColor = bMagenta methodColor = bRed } else { - cW(buf, useColor, bWhite, " ") + _ = cW(buf, useColor, bWhite, " ") } - cW(buf, useColor, pkgColor, "%s", pkg) - cW(buf, useColor, methodColor, "%s\n", method) + _ = cW(buf, useColor, pkgColor, "%s", pkg) + _ = cW(buf, useColor, methodColor, "%s\n", method) // cW(buf, useColor, nBlack, "%s", addr) return buf.String(), nil } @@ -191,19 +191,19 @@ func (s prettyStack) decorateSourceLine(line string, useColor bool, num int) (st lineColor := bGreen if num == 1 { - cW(buf, useColor, bRed, " -> ") + _ = cW(buf, useColor, bRed, " -> ") fileColor = bRed lineColor = bMagenta } else { - cW(buf, false, bWhite, " ") + _ = cW(buf, false, bWhite, " ") } - cW(buf, useColor, bWhite, "%s", dir) - cW(buf, useColor, fileColor, "%s", file) - cW(buf, useColor, lineColor, "%s", lineno) + _ = cW(buf, useColor, bWhite, "%s", dir) + _ = cW(buf, useColor, fileColor, "%s", file) + _ = cW(buf, useColor, lineColor, "%s", lineno) if num == 1 { - cW(buf, false, bWhite, "\n") + _ = cW(buf, false, bWhite, "\n") } - cW(buf, false, bWhite, "\n") + _ = cW(buf, false, bWhite, "\n") return buf.String(), nil } diff --git a/platform/text/text.go b/platform/text/text.go index 8766a302..1031600f 100644 --- a/platform/text/text.go +++ b/platform/text/text.go @@ -132,7 +132,9 @@ func respondText(ctx context.Context, log_id int32) error { if err != nil { log.Error().Err(err).Msg("Failed to wipe memory") content := "Failed to wipe memory" - sendTextCommandResponse(ctx, txn, *src, content) + lint.LogOnErrCtx(func(ctx context.Context) error { + return sendTextCommandResponse(ctx, txn, *src, content) + }, ctx, "send text command response") return fmt.Errorf("reset conversation: %w", err) } return nil