mirror of https://github.com/bjdgyc/anylink.git
修改配置文件报错,停止程序
This commit is contained in:
parent
92de727db8
commit
14efb14a9a
|
@ -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())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue