func LoadConfig(filepath string) (*Config, error) {
	if filepath == "" {
		return nil, nil
	}
	if !(utils.IsFileExist(filepath)) {
		err := errors.New("file is not exist")
		log.Errorf(err, "Load config from %s failed", filepath)
		return nil, err
	}

	byteArr, err := ioutil.ReadFile(filepath)
	if err != nil {
		log.Errorf(err, "Load config from %s failed", filepath)
		return nil, err
	}

	conf := &Config{}
	err = yaml.Unmarshal(byteArr, conf)
	if err != nil {
		log.Errorf(err, "Unmarshal config file failed, content is %s", byteArr)
		return nil, err
	}
	return conf, nil
}
// LoadConfig loads configuration from file
LoadConfig loads configuration from file
// LoadConfig loads configuration from file
func LoadConfig(filepath string) (*Config, error) {
	if filepath == "" {
		return nil, nil
	}
	if !(utils.IsFileExist(filepath)) {
		err := errors.New("file is not exist")
		log.Errorf(err, "Load config from %s failed", filepath)
		return nil, err
	}
	byteArr, err := ioutil.ReadFile(filepath)
	if err != nil {
		log.Errorf(err, "Load config from %s failed", filepath)
		return nil, err
	}
	conf := &Config{}
	err = yaml.Unmarshal(byteArr, conf)
	if err != nil {
		log.Errorf(err, "Unmarshal config file failed, content is %s", byteArr)
		return nil, err
	}
	return conf, nil
}
func LoadConfig ( filepath string ) ( * Config , error ) { if filepath == " " { return nil , nil } if ! ( utils . IsFileExist ( filepath ) ) { err := errors . New ( " " ) log . Errorf ( err , " " , filepath ) return nil , err } byteArr , err := ioutil . ReadFile ( filepath ) if err != nil { log . Errorf ( err , " " , filepath ) return nil , err } conf := & Config { } err = yaml . Unmarshal ( byteArr , conf ) if err != nil { log . Errorf ( err , " " , byteArr ) return nil , err } return conf , nil }
LoadConfig loads configuration from file
LoadConfig loads configuration from file