From b50d39f690ea9074c4ce5928f687d2348ac9e854 Mon Sep 17 00:00:00 2001 From: lifei6671 Date: Fri, 10 Aug 2018 17:59:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=85=BC=E5=AE=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E7=B1=BB=E5=9E=8B=E5=A4=A7=E5=B0=8F=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/command.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/command.go b/commands/command.go index fe9ab12e..1b89dc62 100644 --- a/commands/command.go +++ b/commands/command.go @@ -32,7 +32,7 @@ func RegisterDataBase() { beego.Info("正在初始化数据库配置.") adapter := beego.AppConfig.String("db_adapter") - if adapter == "mysql" { + if strings.EqualFold(adapter, "mysql") { host := beego.AppConfig.String("db_host") database := beego.AppConfig.String("db_database") username := beego.AppConfig.String("db_username") @@ -54,7 +54,7 @@ func RegisterDataBase() { beego.Error("注册默认数据库失败->", err) os.Exit(1) } - } else if adapter == "sqlite3" { + } else if strings.EqualFold(adapter, "sqlite3") { orm.DefaultTimeLoc = time.UTC database := beego.AppConfig.String("db_database") if strings.HasPrefix(database, "./") {