Fix monitoring PF CI lint issues
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user