test cobra

This commit is contained in:
wangchuxiao
2023-03-08 11:45:54 +08:00
parent 60876e865b
commit e55167d0bf
10 changed files with 223 additions and 144 deletions
+3 -3
View File
@@ -502,6 +502,9 @@ func (c *config) initConfig(config interface{}, configName, configFolderPath str
configFolderPath = DefaultFolderPath
}
configPath := filepath.Join(configFolderPath, configName)
defer func() {
fmt.Println("use config", configPath)
}()
_, err := os.Stat(configPath)
if err != nil {
if !os.IsNotExist(err) {
@@ -527,9 +530,6 @@ func (c *config) GetConfFromRegistry(registry discoveryregistry.SvcDiscoveryRegi
}
func InitConfig(configFolderPath string) error {
defer func() {
fmt.Println("use config folder", configFolderPath)
}()
err := Config.initConfig(&Config, FileName, configFolderPath)
if err != nil {
return err