fix: add error logging to remaining nolint:errcheck scan sites for observability
CI / Env docs check (push) Successful in 15s
CI / Docker compose check (push) Successful in 16s
CI / Nginx config check (push) Successful in 20s
CI / Frontend major deps (push) Successful in 30s
CI / Frontend deps check (push) Successful in 32s
CI / Secrets scan (push) Successful in 47s
CI / Go build (push) Successful in 44s
CI / Frontend build (push) Successful in 49s
CI / Go vet (dev) (push) Has been cancelled
CI / Go vet (prod) (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
CI / Staticcheck (dev) (push) Has been cancelled
CI / Staticcheck (prod) (push) Has been cancelled
CI / Security scan (dev) (push) Has been cancelled
CI / Security scan (prod) (push) Has been cancelled
CI / go mod tidy (push) Has been cancelled
CI / Tests (prod) (push) Has been cancelled
CI / Tests (dev) (push) Has been cancelled
CI / Race (prod) (push) Has been cancelled
CI / Race (dev) (push) Has been cancelled
CI / Go vulnerabilities (push) Has been cancelled
CI / Knip (push) Has been cancelled
CI / Frontend a11y check (push) Has been cancelled
CI / Svelte strict check (push) Has been cancelled
CI / Frontend QC (audit) (push) Has been cancelled
CI / Frontend QC (typecheck) (push) Has been cancelled
CI / Frontend QC (lint) (push) Has been cancelled

This commit is contained in:
2026-07-11 15:04:53 +01:00
parent ad15127777
commit f147be0b99
7 changed files with 90 additions and 61 deletions
+7 -4
View File
@@ -7,6 +7,7 @@ import (
"database/sql"
"encoding/json"
"errors"
"log"
"log/slog"
"net/http"
"strconv"
@@ -167,13 +168,15 @@ func GetCustomServices(w http.ResponseWriter, r *http.Request) {
// so pgx does not return "conn busy" on the same transaction.
if q != "" {
var countTotal int64
//nolint:errcheck // zero value is acceptable fallback on scan failure
_ = db.Conn.QueryRow(r.Context(), "SELECT COUNT(*) FROM custom_services WHERE name ILIKE $1 OR description ILIKE $1", "%"+q+"%").Scan(&countTotal)
if err := db.Conn.QueryRow(r.Context(), "SELECT COUNT(*) FROM custom_services WHERE name ILIKE $1 OR description ILIKE $1", "%"+q+"%").Scan(&countTotal); err != nil {
log.Printf("Failed to scan filtered custom services count: %v", err)
}
total = countTotal
} else {
var countTotal int64
//nolint:errcheck // zero value is acceptable fallback on scan failure
_ = db.Conn.QueryRow(r.Context(), "SELECT COUNT(*) FROM custom_services").Scan(&countTotal)
if err := db.Conn.QueryRow(r.Context(), "SELECT COUNT(*) FROM custom_services").Scan(&countTotal); err != nil {
log.Printf("Failed to scan custom services count: %v", err)
}
total = countTotal
}