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

@ -51,3 +51,11 @@ func Write(w io.Writer, p []byte) {
log.Error().Err(err).Msg("write failed")
}
}
// Fprint writes a string to w, logging any error.
func Fprint(w io.Writer, a ...any) {
_, err := fmt.Fprint(w, a...)
if err != nil {
log.Error().Err(err).Msg("fprint failed")
}
}