config setup配置提到外面

This commit is contained in:
linwenxiang committed 2020-12-10 10:24:06 +08:00
1 parent 5f873914e0
commit 0c170fe1c6
4 files changed
+11 -9

No files matched your search

+2 -1
View File
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"github.com/go-admin-team/go-admin-core/config/source/file"
"github.com/spf13/cobra"
"go-admin/tools/config"
@@ -27,7 +28,7 @@ func init() {
}
func run() {
config.Setup(configYml)
config.Setup(file.NewSource, file.WithPath(configYml))
application, errs := json.MarshalIndent(config.ApplicationConfig, "", " ") //转换成JSON返回的是byte[]
if errs != nil {