lint: fix remaining errcheck for Write, Fprintf, Rollback, Commit
- Use lint.Write for unchecked w.Write in handlerJSONPost/Put, report - Use lint.Fprintf for fmt.Fprintf in twilio handlers - Use lint.LogOnErrRollback for deferred Rollbacks in compliance, lead, note - Check errors from txn.Commit in lead, note - Use lint.LogOnErrCtx for addError calls in flyover
This commit is contained in:
parent
679d12b48f
commit
808e172221
7 changed files with 36 additions and 18 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
"github.com/Gleipnir-Technology/bob/dialect/psql"
|
||||
"github.com/Gleipnir-Technology/bob/dialect/psql/sm"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/lint"
|
||||
modelpublic "github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/model"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
querypublic "github.com/Gleipnir-Technology/nidus-sync/db/query/public"
|
||||
|
|
@ -25,7 +26,7 @@ func ComplianceRequestMailerCreate(ctx context.Context, user User, site_id int64
|
|||
if err != nil {
|
||||
return 0, fmt.Errorf("start txn: %w", err)
|
||||
}
|
||||
defer txn.Rollback(ctx)
|
||||
defer lint.LogOnErrRollback(txn.Rollback, ctx, "rollback")
|
||||
site, err := querypublic.SiteFromIDForOrg(ctx, txn, site_id, int64(user.Organization.ID))
|
||||
if err != nil {
|
||||
return 0, fmt.Errorf("find site: %w", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue