fix init error of global instance

This commit is contained in:
Ming Deng
2020-11-05 22:00:43 +08:00
parent 471ebba64d
commit b4396c97bb
4 changed files with 12 additions and 15 deletions

View File

@@ -14,22 +14,10 @@
package config
import (
"github.com/astaxie/beego/core/logs"
)
// We use this to simply application's development
// for most users, they only need to use those methods
var globalInstance Configer
func init() {
// Ignore this error
err := InitGlobalInstance("ini", "config/app.conf")
if err != nil {
logs.Warn("init global config instance failed. If you donot use this, just ignore it. ", err)
}
}
// InitGlobalInstance will ini the global instance
// If you want to use specific implementation, don't forget to import it.