🐝 reformat code
This commit is contained in:
@@ -13,20 +13,20 @@ import (
|
||||
func ReadConf(config string) bool {
|
||||
log.Infof("读取配置文件...")
|
||||
if !utils.Exists(config) {
|
||||
log.Infof("找不到配置文件:%s",config)
|
||||
log.Infof("找不到配置文件:%s", config)
|
||||
return false
|
||||
}
|
||||
confFile,err:=ioutil.ReadFile(config)
|
||||
if err !=nil {
|
||||
log.Errorf("读取配置文件时发生错误:%s",err.Error())
|
||||
confFile, err := ioutil.ReadFile(config)
|
||||
if err != nil {
|
||||
log.Errorf("读取配置文件时发生错误:%s", err.Error())
|
||||
return false
|
||||
}
|
||||
err = yaml.Unmarshal(confFile, conf.Conf)
|
||||
if err !=nil {
|
||||
log.Errorf("加载配置文件时发生错误:%s",err.Error())
|
||||
if err != nil {
|
||||
log.Errorf("加载配置文件时发生错误:%s", err.Error())
|
||||
return false
|
||||
}
|
||||
log.Debugf("config:%+v",conf.Conf)
|
||||
conf.Origins = strings.Split(conf.Conf.Server.SiteUrl,",")
|
||||
log.Debugf("config:%+v", conf.Conf)
|
||||
conf.Origins = strings.Split(conf.Conf.Server.SiteUrl, ",")
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user