From 05bad5997fc60e26bb3b904ed6aba65116e140e3 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Sat, 22 Jul 2023 15:09:47 +0800 Subject: [PATCH] upgrade github.com/alimy/cfg => v0.4.0 --- go.mod | 2 +- go.sum | 4 ++-- internal/dao/dao.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 5401b2d9..11cff3c1 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/Masterminds/semver/v3 v3.2.1 github.com/afocus/captcha v0.0.0-20191010092841-4bd1f21c8868 - github.com/alimy/cfg v0.3.0 + github.com/alimy/cfg v0.4.0 github.com/alimy/mir/v4 v4.0.0-rc.1 github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible github.com/allegro/bigcache/v3 v3.1.0 diff --git a/go.sum b/go.sum index eff06174..f3476fb7 100644 --- a/go.sum +++ b/go.sum @@ -123,8 +123,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/alexflint/go-filemutex v1.1.0/go.mod h1:7P4iRhttt/nUvUOrYIhcpMzv2G6CY9UnI16Z+UJqRyk= -github.com/alimy/cfg v0.3.0 h1:9xgA0QWVCPSq9fFNRcYahVCAX22IL9ts2wrTQPfAStY= -github.com/alimy/cfg v0.3.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c= +github.com/alimy/cfg v0.4.0 h1:SslKPndmxRViT1ePWLmNsEq7okYP0GVeuowQlRWZPkw= +github.com/alimy/cfg v0.4.0/go.mod h1:rOxbasTH2srl6StAjNF5Vyi8bfrdkl3fLGmOYtSw81c= github.com/alimy/mir/v4 v4.0.0-rc.1 h1:x9rKbD6I4INqwvgmSI4Vbswff66ANDnPmCySMLzEV4w= github.com/alimy/mir/v4 v4.0.0-rc.1/go.mod h1:d58dBvw2KImcVbAUANrciEV/of0arMNsI9c/5UNCMMc= github.com/aliyun/aliyun-oss-go-sdk v2.2.7+incompatible h1:KpbJFXwhVeuxNtBJ74MCGbIoaBok2uZvkD7QXp2+Wis= diff --git a/internal/dao/dao.go b/internal/dao/dao.go index d0b05c9c..2fcdd580 100644 --- a/internal/dao/dao.go +++ b/internal/dao/dao.go @@ -30,9 +30,9 @@ func DataService() core.DataService { var v core.VersionInfo if cfg.If("Gorm") { ds, v = jinzhu.NewDataService() - } else if cfg.If("Sqlx") && cfg.If("MySQL") { + } else if cfg.All("Sqlx", "MySQL") { ds, v = sakila.NewDataService() - } else if cfg.If("Sqlx") && (cfg.If("Postgres") || cfg.If("PostgreSQL")) { + } else if cfg.If("Sqlx") && cfg.Any("Postgres", "PostgreSQL") { ds, v = slonik.NewDataService() } else { // default use gorm as orm for sql database @@ -93,9 +93,9 @@ func TweetSearchService() core.TweetSearchService { func newAuthorizationManageService() (s core.AuthorizationManageService) { if cfg.If("Gorm") { s = jinzhu.NewAuthorizationManageService() - } else if cfg.If("Sqlx") && cfg.If("MySQL") { + } else if cfg.All("Sqlx", "MySQL") { s = sakila.NewAuthorizationManageService() - } else if cfg.If("Sqlx") && (cfg.If("Postgres") || cfg.If("PostgreSQL")) { + } else if cfg.If("Sqlx") && cfg.Any("Postgres", "PostgreSQL") { s = slonik.NewAuthorizationManageService() } else { s = jinzhu.NewAuthorizationManageService()