lint: fix errcheck for txn calls, query results, and unchecked errors

- Fix Rollback/Commit in compliance.go, csv/csv.go, csv/pool.go
- Capture and check errors from .One() insert queries in send.go, text.go
- Check errors from markFunc, PopulateURL, and hydrate functions
- Use lint.LogOnErrCtx for best-effort notification sends
This commit is contained in:
Eli Ribble 2026-05-09 02:35:55 +00:00
parent 0ec810591e
commit 679d12b48f
No known key found for this signature in database
10 changed files with 47 additions and 16 deletions

View file

@ -269,10 +269,16 @@ func (res *complianceR) byID(ctx context.Context, r *http.Request, is_public boo
return res.complianceHydrate(report, is_public)
}
func (res *complianceR) complianceHydrate(report *types.PublicReportCompliance, is_public bool) (*types.PublicReportCompliance, *nhttp.ErrorWithStatus) {
populateDistrictURI(&report.PublicReport, res.router)
populateReportURI(&report.PublicReport, res.router, is_public)
if err := populateDistrictURI(&report.PublicReport, res.router); err != nil {
return nil, nhttp.NewError("populate district URI: %w", err)
}
if err := populateReportURI(&report.PublicReport, res.router, is_public); err != nil {
return nil, nhttp.NewError("populate report URI: %w", err)
}
for _, e := range report.Concerns {
e.PopulateURL(res.router.router)
if err := e.PopulateURL(res.router.router); err != nil {
return nil, nhttp.NewError("populate concern URL: %w", err)
}
}
return report, nil
}