func ReadModelsFile(file string) (map[string]*ControllerModels, error) {
	data, err := ioutil.ReadFile(file)
	if err != nil {
		if os.IsNotExist(err) {
			return nil, nil
		}
		return nil, err
	}
	models, err := ParseModels(data)
	if err != nil {
		return nil, err
	}
	if err := migrateLocalModelUsers(models); err != nil {
		return nil, err
	}
	if err := addModelType(models); err != nil {
		return nil, err
	}
	if featureflag.Enabled(feature.Branches) || featureflag.Enabled(feature.Generations) {
		if err := addGeneration(models); err != nil {
			return nil, err
		}
	}
	return models, nil
}
// ReadModelsFile loads all models defined in a given file.
// If the file is not found, it is not an error.
ReadModelsFile loads all models defined in a given file.
If the file is not found, it is not an error.
// ReadModelsFile loads all models defined in a given file . // If the file is not found it is not an error .
func ReadModelsFile(file string) (map[string]*ControllerModels, error) {
	data, err := ioutil.ReadFile(file)
	if err != nil {
		if os.IsNotExist(err) {
			return nil, nil
		}
		return nil, err
	}
	models, err := ParseModels(data)
	if err != nil {
		return nil, err
	}
	if err := migrateLocalModelUsers(models); err != nil {
		return nil, err
	}
	if err := addModelType(models); err != nil {
		return nil, err
	}
	if featureflag.Enabled(feature.Branches) || featureflag.Enabled(feature.Generations) {
		if err := addGeneration(models); err != nil {
			return nil, err
		}
	}
	return models, nil
}
func ReadModelsFile ( file string ) ( map [ string ] * ControllerModels , error ) { data , err := ioutil . ReadFile ( file ) if err != nil { if os . IsNotExist ( err ) { return nil , nil } return nil , err } models , err := ParseModels ( data ) if err != nil { return nil , err } if err := migrateLocalModelUsers ( models ) ; err != nil { return nil , err } if err := addModelType ( models ) ; err != nil { return nil , err } if featureflag . Enabled ( feature . Branches ) || featureflag . Enabled ( feature . Generations ) { if err := addGeneration ( models ) ; err != nil { return nil , err } } return models , nil }
ReadModelsFile loads all models defined in a given file.
ReadModelsFile loads all models defined in a given file .