//ParseEntries used to clean attributes of an object class.
ParseEntries used to clean attributes of an object class.
// ParseEntries used to clean attributes of an object class .
func (lc HelperLDAP) ParseEntries(entry string) map[string][]string {
	var listEntries = make(map[string][]string)
	for _, ent := range strings.Split(entry, ",") {
		key := strings.SplitN(ent, "=", 2)
		if len(key) != 2 || len(key[0]) < 1 || len(key[1]) < 1 {
			continue
		}
		key[0] = strings.TrimSpace(key[0])
		key[1] = strings.TrimSpace(key[1])
		if _, ok := listEntries[key[0]]; !ok {
			listEntries[key[0]] = []string{}
		}
		listEntries[key[0]] = append(listEntries[key[0]], key[1])
	}
	return listEntries
}
func ( lc HelperLDAP ) ParseEntries ( entry string ) map [ string ] [ ] string { var listEntries = make ( map [ string ] [ ] string ) for _ , ent := range strings . Split ( entry , " " ) { key := strings . SplitN ( ent , " " , 2 ) if len ( key ) != 2 || len ( key [ 0 ] ) < 1 || len ( key [ 1 ] ) < 1 { continue } key [ 0 ] = strings . TrimSpace ( key [ 0 ] ) key [ 1 ] = strings . TrimSpace ( key [ 1 ] ) if _ , ok := listEntries [ key [ 0 ] ] ; ! ok { listEntries [ key [ 0 ] ] = [ ] string { } } listEntries [ key [ 0 ] ] = append ( listEntries [ key [ 0 ] ] , key [ 1 ] ) } return listEntries }
ParseEntries used to clean attributes of an object class.
ParseEntries used to clean attributes of an object class .