Fix monitoring PF CI lint issues
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 37s
CI / go (push) Successful in 43s
CI / python (push) Successful in 2s

This commit is contained in:
Grendgi
2026-06-09 11:33:33 +03:00
parent 95112cc450
commit d53ecb2add
6 changed files with 36 additions and 28 deletions

View File

@@ -137,6 +137,14 @@ func (a *App) Close() error {
return a.DB.Close()
}
func closeRows(rows *sql.Rows) {
_ = rows.Close()
}
func rollbackTx(tx *sql.Tx) {
_ = tx.Rollback()
}
func (a *App) InitDB(ctx context.Context) error {
stmts := []string{
`CREATE TABLE IF NOT EXISTS employees (
@@ -210,7 +218,7 @@ func (a *App) migrateEmployees(ctx context.Context) error {
if err != nil {
return err
}
defer rows.Close()
defer closeRows(rows)
columns := map[string]bool{}
for rows.Next() {
var cid int
@@ -237,7 +245,7 @@ func (a *App) migrateCompetitorListings(ctx context.Context) error {
if err != nil {
return err
}
defer rows.Close()
defer closeRows(rows)
columns := map[string]bool{}
for rows.Next() {
var cid int
@@ -325,15 +333,6 @@ func enumStatusOut(value string) string {
}
}
func enumStatusIn(value string) string {
switch strings.ToLower(value) {
case "removed":
return "REMOVED"
default:
return "ACTIVE"
}
}
func timeOut(raw sql.NullString) *string {
if !raw.Valid || strings.TrimSpace(raw.String) == "" {
return nil