diff --git a/CHANGELOG.md b/CHANGELOG.md index a749b7be..4e11a696 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - [Fix 5079: Split signalChan into flushChan and closeChan](https://github.com/beego/beego/pull/5139) - [Fix 5172: protect field access with lock to avoid possible data race](https://github.com/beego/beego/pull/5210) - [cache: fix typo and optimize the naming]() +- [Fix 5176: beegoAppConfig String and Strings function has bug](https://github.com/beego/beego/pull/5211) # v2.0.7 - [Upgrade github.com/go-kit/kit, CVE-2022-24450](https://github.com/beego/beego/pull/5121) diff --git a/adapter/config.go b/adapter/config.go index 36e0a9c4..f05369d2 100644 --- a/adapter/config.go +++ b/adapter/config.go @@ -87,7 +87,7 @@ func (b *beegoAppConfig) String(key string) string { } func (b *beegoAppConfig) Strings(key string) []string { - if v, err := b.innerConfig.Strings(BConfig.RunMode + "::" + key); len(v) > 0 && err != nil { + if v, err := b.innerConfig.Strings(BConfig.RunMode + "::" + key); len(v) > 0 && err == nil { return v } res, _ := b.innerConfig.Strings(key)