Skip to content

Commit

Permalink
refactor(orm): use panic
Browse files Browse the repository at this point in the history
  • Loading branch information
adhocore committed Apr 17, 2021
1 parent b3cadf9 commit c16c881
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions orm/postgres.go
Expand Up @@ -2,7 +2,6 @@ package orm

import (
"fmt"
"log"
"net"
"net/url"
"os"
Expand All @@ -22,7 +21,7 @@ var conn *gorm.DB
func pgConnect() *gorm.DB {
dsn := os.Getenv("DATABASE_URL")
if dsn == "" {
log.Fatal("Database configuration DSN missing, Pass in DATABASE_URL env")
panic("Database configuration DSN missing, Pass in DATABASE_URL env")
}

parse, _ := url.Parse(dsn)
Expand All @@ -44,7 +43,7 @@ func pgConnect() *gorm.DB {
})

if err != nil {
log.Fatalf("database error: %v", err)
panic("database error: " + err.Error())
}

_ = db.AutoMigrate(&model.Keyword{}, &model.URL{})
Expand Down

0 comments on commit c16c881

Please sign in to comment.