provider/designate.go
func (p designateProvider) getHostZoneID(hostname string, managedZones map[string]string) (string, error) {
	longestZoneLength := 0
	resultID := ""

	for zoneID, zoneName := range managedZones {
		if !strings.HasSuffix(hostname, zoneName) {
			continue
		}
		ln := len(zoneName)
		if ln > longestZoneLength {
			resultID = zoneID
			longestZoneLength = ln
		}
	}

	return resultID, nil
}
func (p designateProvider) getHostZoneID(hostname string, managedZones map[string]string) (string, error) {
	longestZoneLength := 0
	resultID := ""

	for zoneID, zoneName := range managedZones {
		if !strings.HasSuffix(hostname, zoneName) {
			continue
		}
		ln := len(zoneName)
		if ln > longestZoneLength {
			resultID = zoneID
			longestZoneLength = ln
		}
	}

	return resultID, nil
}
func ( p designateProvider ) getHostZoneID ( hostname string , managedZones map [ string ] string ) ( string , error ) { longestZoneLength := 0 resultID := " " for zoneID , zoneName := range managedZones { if ! strings . HasSuffix ( hostname , zoneName ) { continue } ln := len ( zoneName ) if ln > longestZoneLength { resultID = zoneID longestZoneLength = ln } } return resultID , nil }
// finds best suitable DNS zone for the hostname
finds best suitable DNS zone for the hostname