Apply mechanical lint fixes for golangci-lint v2.12.2 rollout

Auto-remediate style-only findings (wsl_v5, nlreturn, noinlineerr,
modernize, intrange, perfsprint, usetesting, unconvert, errorlint,
gocritic, testifylint) and rename printf-style helpers to f-suffixed
names (goprintffuncname): ui.Writer message methods, cli.ReportErrorf,
database.Fatalf, vaultik stdoutf.
This commit is contained in:
2026-08-07 17:01:52 +00:00
parent 23d22a0f19
commit 6cf9211407
110 changed files with 2566 additions and 722 deletions

View File

@@ -6,15 +6,16 @@ import (
"os"
)
// Fatal prints an error message to stderr and exits with status 1
func Fatal(format string, args ...interface{}) {
// Fatalf prints an error message to stderr and exits with status 1
func Fatalf(format string, args ...any) {
fmt.Fprintf(os.Stderr, "FATAL: "+format+"\n", args...)
os.Exit(1)
}
// CloseRows closes rows and exits on error
func CloseRows(rows *sql.Rows) {
if err := rows.Close(); err != nil {
Fatal("failed to close rows: %v", err)
err := rows.Close()
if err != nil {
Fatalf("failed to close rows: %v", err)
}
}