lint: fix errcheck for fmt.Fprintf/Fprint across multiple files

Add lint.Fprint helper for unchecked fmt.Fprint calls.
Use lint.Fprintf/Fprint in api/event.go, api/image.go, rmo/root.go.
Add explicit error check for fmt.Fprintf in middleware/terminal.go cW.
This commit is contained in:
Eli Ribble 2026-05-09 02:21:53 +00:00
parent 934fb03ca2
commit c7a7e8431c
No known key found for this signature in database
5 changed files with 20 additions and 8 deletions

View file

@ -59,9 +59,12 @@ func cW(w io.Writer, useColor bool, color []byte, s string, args ...interface{})
return fmt.Errorf("write color: %w", err)
}
}
fmt.Fprintf(w, s, args...)
_, err := fmt.Fprintf(w, s, args...)
if err != nil {
return fmt.Errorf("fprintf: %w", err)
}
if IsTTY && useColor {
_, err := w.Write(reset)
_, err = w.Write(reset)
if err != nil {
return fmt.Errorf("write color: %w", err)
}