// GetExternalConfig provides the externalConfig.
GetExternalConfig provides the externalConfig.
// GetExternalConfig provides the externalConfig .
func GetExternalConfig(
	filePath string,
	dirPath string,
) (*ExternalConfig, error) {
	newPath, err := getExternalConfigPath(filePath, dirPath)
	if err != nil {
		if len(filePath) == 0 && len(dirPath) == 0 {
			return nil, nil
		}
		return nil, err
	}
	data, err := ioutil.ReadFile(newPath)
	if err != nil {
		return nil, err
	}
	if len(data) == 0 {
		return nil, fmt.Errorf("read %s, but the content is empty", newPath)
	}
	var config ExternalConfig
	if err := yaml.UnmarshalStrict(data, &config); err != nil {
		return nil, err
	}
	config.SourcePath = newPath
	return &config, nil
}
func GetExternalConfig ( filePath string , dirPath string , ) ( * ExternalConfig , error ) { newPath , err := getExternalConfigPath ( filePath , dirPath ) if err != nil { if len ( filePath ) == 0 && len ( dirPath ) == 0 { return nil , nil } return nil , err } data , err := ioutil . ReadFile ( newPath ) if err != nil { return nil , err } if len ( data ) == 0 { return nil , fmt . Errorf ( " " , newPath ) } var config ExternalConfig if err := yaml . UnmarshalStrict ( data , & config ) ; err != nil { return nil , err } config . SourcePath = newPath return & config , nil }
GetExternalConfig provides the externalConfig.
GetExternalConfig provides the externalConfig .