修改配置文件报错,停止程序

This commit is contained in:
bjdgyc 2023-05-30 15:52:20 +08:00
parent 92de727db8
commit 14efb14a9a
1 changed files with 1 additions and 2 deletions

View File

@ -80,7 +80,6 @@ func initCmd() {
linkViper.SetEnvPrefix("link")
// 基础配置
for _, v := range configs {
if v.Typ == cfgStr {
rootCmd.Flags().StringP(v.Name, v.Short, v.ValStr, v.Usage)
@ -113,7 +112,7 @@ func initCmd() {
linkViper.SetConfigFile(conf)
err = linkViper.ReadInConfig()
if err != nil {
fmt.Println("Using config file:", err)
panic("config file err:" + err.Error())
}
})
}