Repository navigation
Commit feaa190
committed
fix(auth): satisfy errcheck and shadow lints in bootstrap tx scaffolding
The bootstrap-race fix introduced two new golangci-lint failures on the
new transaction scaffolding in CreateAdminIfNone (Lint Code is failing
on this PR for these reasons):
- `_ = tx.Rollback(ctx)` does not satisfy errcheck under this project's
`check-blank: true` setting. Replace with the project-standard
`defer tx.Rollback(ctx) //nolint:errcheck` pattern used in
internal/config/store_postgres.go.
- `if _, err := tx.Exec(...)` on the advisory-lock acquire shadowed the
outer `err` (govet shadow). Drop the short-declaration so the
lock-exec assigns to the outer variable.
No behavior change on the success or known-error paths.
go test ./internal/auth/ -race: 577 passed.
golangci-lint on store_postgres.go: no new findings on the touched
lines.1 parent 143babc commit feaa190
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
433 | 433 | | |
434 | 434 | | |
435 | 435 | | |
436 | | - | |
437 | | - | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
441 | | - | |
| 442 | + | |
442 | 443 | | |
443 | 444 | | |
444 | 445 | | |
| |||
0 commit comments