Skip to content

Commit

Permalink
fix: config
Browse files Browse the repository at this point in the history
  • Loading branch information
jie authored and jie committed Sep 10, 2020
1 parent 0c57800 commit c566930
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,20 @@ func GetConfigCache() (conf Config, err error) {
if err != nil {
log.Println("没有找到配置文件!请在网页中输入")
cache.Err = err
return *cache.ConfigSingle, err
}

byt, err := ioutil.ReadFile(configFilePath)
if err != nil {
log.Println("config.yaml读取失败")
cache.Err = err
return *cache.ConfigSingle, err
}

err = yaml.Unmarshal(byt, cache.ConfigSingle)
if err != nil {
log.Println("反序列化配置文件失败", err)
cache.Err = err
}
return *cache.ConfigSingle, err
}
Expand Down

0 comments on commit c566930

Please sign in to comment.