From 6d142803ccc50a384868fd2a768c7559fc050992 Mon Sep 17 00:00:00 2001 From: iyear Date: Tue, 15 Jun 2021 09:02:17 +0800 Subject: [PATCH] remove error return --- model/sqlite.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model/sqlite.go b/model/sqlite.go index f7699fb..f14e0d5 100644 --- a/model/sqlite.go +++ b/model/sqlite.go @@ -1,6 +1,7 @@ package model import ( + "go.uber.org/zap" "gorm.io/driver/sqlite" "gorm.io/gorm" "time" @@ -8,16 +9,15 @@ import ( var DB *gorm.DB -func InitDB() error { +func InitDB() { var err error DB, err = gorm.Open(sqlite.Open("data.db"), &gorm.Config{ NowFunc: func() time.Time { - return time.Now().UTC() + return time.Now() }, }) if err != nil { - return err + zap.S().Errorw("failed to open db", "error", err) } DB.AutoMigrate(&Client{}) - return nil }