config path

This commit is contained in:
wangchuxiao
2023-02-23 19:41:44 +08:00
parent 8bdf86172f
commit a26ca657fe
9 changed files with 43 additions and 19 deletions
+3 -6
View File
@@ -1,7 +1,6 @@
package config
import (
"flag"
"fmt"
"io/ioutil"
"os"
@@ -537,10 +536,8 @@ func initConfig(config interface{}, configName, configPath string) {
unmarshalConfig(config, configPath)
}
func InitConfig() {
configPath := flag.String("config_path", "../config/", "config folder")
flag.Parse()
initConfig(&Config, "config.yaml", *configPath)
initConfig(&NotificationConfig, "notification.yaml", *configPath)
func InitConfig(configPath string) {
initConfig(&Config, "config.yaml", configPath)
initConfig(&NotificationConfig, "notification.yaml", configPath)
Config.Notification = NotificationConfig.Notification
}