Skip to content

Commit

Permalink
fix: Resolve a nil pointer dereference issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobefu committed Jan 18, 2025
1 parent f69432e commit f4eb03d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

var databaseConnect = database.Connect
var dbPing = database.DB.Ping
var dbPing = func() error { return database.DB.Ping() }
var flagNewFlagSet = flag.NewFlagSet

var checkHealthMain = check_health.Main
Expand Down Expand Up @@ -51,7 +51,7 @@ func initDB() {
err = dbPing()

if err != nil {
loggerFatal("Could not connect to the database: %s", err.Error())
loggerFatal("Could not ping the database: %s", err.Error())
}
}

Expand Down

0 comments on commit f4eb03d

Please sign in to comment.