From dd33153ca1cff19fb77c84ad30d6bc9822562d36 Mon Sep 17 00:00:00 2001 From: kzkzzzz Date: Sat, 29 Jun 2024 22:11:39 +0800 Subject: [PATCH] update --- mymysql/mysql.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mymysql/mysql.go b/mymysql/mysql.go index a66f557..bf39564 100644 --- a/mymysql/mysql.go +++ b/mymysql/mysql.go @@ -53,17 +53,16 @@ func DB(key ...string) *gorm.DB { return instance } -func InitDefault(config *Config) error { - return Init(DefaultKey, config) +func InitDefault(config *Config) { + Init(DefaultKey, config) } -func Init(key string, config *Config) error { +func Init(key string, config *Config) { db, err := New(config) if err != nil { - return err + panic(err) } instanceMap[key] = db - return nil } func New(config *Config) (*gorm.DB, error) {