func (u *UserInfoLDAPSource) GetEmailofauser(username string) ([]string, error) {
	conn, err := u.getTargetLDAPConnection()
	if err != nil {
		log.Println(err)
		return nil, err
	}
	defer conn.Close()
	result, err := u.getInfoofUserInternal(conn, username, []string{"mail"})
	if err != nil {
		log.Println(err)
		return nil, err
	}
	email, ok := result["mail"]
	if !ok {
		log.Println("Failed to get email")
		return nil, errors.New("Failed to get email")
	}
	return email, nil
}
//get email of a user
get email of a user
// get email of a user
func (u *UserInfoLDAPSource) GetEmailofauser(username string) ([]string, error) {
	conn, err := u.getTargetLDAPConnection()
	if err != nil {
		log.Println(err)
		return nil, err
	}
	defer conn.Close()
	result, err := u.getInfoofUserInternal(conn, username, []string{"mail"})
	if err != nil {
		log.Println(err)
		return nil, err
	}
	email, ok := result["mail"]
	if !ok {
		log.Println("Failed to get email")
		return nil, errors.New("Failed to get email")
	}
	return email, nil
}
func ( u * UserInfoLDAPSource ) GetEmailofauser ( username string ) ( [ ] string , error ) { conn , err := u . getTargetLDAPConnection ( ) if err != nil { log . Println ( err ) return nil , err } defer conn . Close ( ) result , err := u . getInfoofUserInternal ( conn , username , [ ] string { " " } ) if err != nil { log . Println ( err ) return nil , err } email , ok := result [ " " ] if ! ok { log . Println ( " " ) return nil , errors . New ( " " ) } return email , nil }
get email of a user
get email of a user