M sdbapi/main.go => sdbapi/main.go +11 -2
@@ 20,14 20,23 @@ import (
)
func main() {
- err := setUlimits()
+ // stores various errors during startup
+ var err error
+
+ err = setUlimits()
if err != nil {
log.Fatal("failed to set Ulimits")
}
dbConnectionString := os.Getenv("GORM_DB_STRING")
+ if dbConnectionString == "" {
+ log.Fatal("environment variable 'GORM_DB_STRING' is not set")
+ }
- db.Connect(dbConnectionString)
+ err = db.Connect(dbConnectionString)
+ if err != nil {
+ log.Fatal(err)
+ }
db.Migrate()