func parseYaml(path string, cfg interface{}, errorOnFileNotFound bool) error {
	file, err := os.Open(path)
	if err != nil {
		if errorOnFileNotFound {
			return err
		} else {
			return nil
		}
	}

	defer func() {
		e := file.Close()
		if e != nil {
			err = e
		}
	}()

	if err := yaml.NewDecoder(file).Decode(cfg); err != nil {
		return err
	}

	return err
}
// Parses configuration data of a yaml file
Parses configuration data of a yaml file
// Parses configuration data of a yaml file
func parseYaml(path string, cfg interface{}, errorOnFileNotFound bool) error {
	file, err := os.Open(path)
	if err != nil {
		if errorOnFileNotFound {
			return err
		} else {
			return nil
		}
	}
	defer func() {
		e := file.Close()
		if e != nil {
			err = e
		}
	}()
	if err := yaml.NewDecoder(file).Decode(cfg); err != nil {
		return err
	}
	return err
}
func parseYaml ( path string , cfg interface { } , errorOnFileNotFound bool ) error { file , err := os . Open ( path ) if err != nil { if errorOnFileNotFound { return err } else { return nil } } defer func ( ) { e := file . Close ( ) if e != nil { err = e } } ( ) if err := yaml . NewDecoder ( file ) . Decode ( cfg ) ; err != nil { return err } return err }
Parses configuration data of a yaml file
Parses configuration data of a yaml file