func GetAttributeValue(entry *ldap.Entry, attributes []string) string {
	for _, k := range attributes {
		// Ignore empty attributes
		if len(k) == 0 {
			continue
		}
		// Special-case DN, since it's not an attribute
		if strings.ToLower(k) == "dn" {
			return entry.DN
		}
		// Otherwise get an attribute and return it if present
		if v := entry.GetAttributeValue(k); len(v) > 0 {
			return v
		}
	}
	return ""
}
// GetAttributeValue finds the first attribute of those given that the LDAP entry has, and
// returns it. GetAttributeValue is able to query the DN as well as Attributes of the LDAP entry.
// If no value is found, the empty string is returned.
GetAttributeValue finds the first attribute of those given that the LDAP entry has, and
returns it. GetAttributeValue is able to query the DN as well as Attributes of the LDAP entry.
If no value is found, the empty string is returned.
// GetAttributeValue finds the first attribute of those given that the LDAP entry has and // returns it . GetAttributeValue is able to query the DN as well as Attributes of the LDAP entry . // If no value is found the empty string is returned .
func GetAttributeValue(entry *ldap.Entry, attributes []string) string {
	for _, k := range attributes {
		if len(k) == 0 {
			continue
		}
		if strings.ToLower(k) == "dn" {
			return entry.DN
		}
		if v := entry.GetAttributeValue(k); len(v) > 0 {
			return v
		}
	}
	return ""
}
func GetAttributeValue ( entry * ldap . Entry , attributes [ ] string ) string { for _ , k := range attributes { if len ( k ) == 0 { continue } if strings . ToLower ( k ) == " " { return entry . DN } if v := entry . GetAttributeValue ( k ) ; len ( v ) > 0 { return v } } return " " }
GetAttributeValue finds the first attribute of those given that the LDAP entry has, and
returns it.
GetAttributeValue finds the first attribute of those given that the LDAP entry has and returns it .
// Ignore empty attributes // Special-case DN, since it's not an attribute // Otherwise get an attribute and return it if present