func RegionByName(regions []Region, name string) (*Region, error) {
	for _, region := range regions {
		if !strings.EqualFold(region.Name, name) {
			continue
		}
		return &region, nil
	}
	availableRegions := "cloud has no regions"
	if len(regions) > 0 {
		availableRegions = fmt.Sprintf("expected one of %q", RegionNames(regions))
	}
	return nil, errors.NewNotFound(nil, fmt.Sprintf(
		"region %q not found (%v)",
		name, availableRegions,
	))
}
// RegionByName finds the region in the given slice with the
// specified name, with case folding.
RegionByName finds the region in the given slice with the
specified name, with case folding.
// RegionByName finds the region in the given slice with the // specified name with case folding .
func RegionByName(regions []Region, name string) (*Region, error) {
	for _, region := range regions {
		if !strings.EqualFold(region.Name, name) {
			continue
		}
		return &region, nil
	}
	availableRegions := "cloud has no regions"
	if len(regions) > 0 {
		availableRegions = fmt.Sprintf("expected one of %q", RegionNames(regions))
	}
	return nil, errors.NewNotFound(nil, fmt.Sprintf(
		"region %q not found (%v)",
		name, availableRegions,
	))
}
func RegionByName ( regions [ ] Region , name string ) ( * Region , error ) { for _ , region := range regions { if ! strings . EqualFold ( region . Name , name ) { continue } return & region , nil } availableRegions := " " if len ( regions ) > 0 { availableRegions = fmt . Sprintf ( " " , RegionNames ( regions ) ) } return nil , errors . NewNotFound ( nil , fmt . Sprintf ( " " , name , availableRegions , ) ) }
RegionByName finds the region in the given slice with the
specified name, with case folding.
RegionByName finds the region in the given slice with the specified name with case folding .