feat ✨: 配置文件扩展项使用

This commit is contained in:
wenjianzhang committed 2021-03-31 19:06:25 +08:00
1 parent 30feaae7e7
commit aefdb47c32
2 files changed
+20 -2

No files matched your search

+4 -2
View File
@@ -22,6 +22,7 @@ import (
"go-admin/app/jobs"
"go-admin/common/database"
"go-admin/common/global"
ext "go-admin/config"
)
var (
@@ -50,7 +51,8 @@ func init() {
}
func setup() {
// 注入配置扩展项
config.ExtendConfig = &ext.ExtConfig
//1. 读取配置
config.Setup(file.NewSource, file.WithPath(configYml))
go config.Watch()
@@ -148,4 +150,4 @@ func run() error {
func tip() {
usageStr := `欢迎使用 ` + pkg.Green(`go-admin `+global.Version) + ` 可以使用 ` + pkg.Red(`-h`) + ` 查看命令`
fmt.Printf("%s \n\n", usageStr)
}
}