func SplitLDAPQuery(query string) (attributes, scope, filter, extensions string, err error) {
	parts := strings.Split(query, "?")
	switch len(parts) {
	case 4:
		extensions = parts[3]
		fallthrough
	case 3:
		if v, err := url.QueryUnescape(parts[2]); err != nil {
			return "", "", "", "", err
		} else {
			filter = v
		}
		fallthrough
	case 2:
		if v, err := url.QueryUnescape(parts[1]); err != nil {
			return "", "", "", "", err
		} else {
			scope = v
		}
		fallthrough
	case 1:
		if v, err := url.QueryUnescape(parts[0]); err != nil {
			return "", "", "", "", err
		} else {
			attributes = v
		}
		return attributes, scope, filter, extensions, nil
	case 0:
		return
	default:
		err = fmt.Errorf("too many query options %q", query)
		return "", "", "", "", err
	}
}
// SplitLDAPQuery splits the query in the URL into the substituent parts. All sections are optional.
// Query syntax is attribute?scope?filter?extensions
SplitLDAPQuery splits the query in the URL into the substituent parts. All sections are optional.
// SplitLDAPQuery splits the query in the URL into the substituent parts . All sections are optional . // Query syntax is attribute?scope?filter?extensions
func SplitLDAPQuery(query string) (attributes, scope, filter, extensions string, err error) {
	parts := strings.Split(query, "?")
	switch len(parts) {
	case 4:
		extensions = parts[3]
		fallthrough
	case 3:
		if v, err := url.QueryUnescape(parts[2]); err != nil {
			return "", "", "", "", err
		} else {
			filter = v
		}
		fallthrough
	case 2:
		if v, err := url.QueryUnescape(parts[1]); err != nil {
			return "", "", "", "", err
		} else {
			scope = v
		}
		fallthrough
	case 1:
		if v, err := url.QueryUnescape(parts[0]); err != nil {
			return "", "", "", "", err
		} else {
			attributes = v
		}
		return attributes, scope, filter, extensions, nil
	case 0:
		return
	default:
		err = fmt.Errorf("too many query options %q", query)
		return "", "", "", "", err
	}
}
func SplitLDAPQuery ( query string ) ( attributes , scope , filter , extensions string , err error ) { parts := strings . Split ( query , " " ) switch len ( parts ) { case 4 : extensions = parts [ 3 ] fallthrough case 3 : if v , err := url . QueryUnescape ( parts [ 2 ] ) ; err != nil { return " " , " " , " " , " " , err } else { filter = v } fallthrough case 2 : if v , err := url . QueryUnescape ( parts [ 1 ] ) ; err != nil { return " " , " " , " " , " " , err } else { scope = v } fallthrough case 1 : if v , err := url . QueryUnescape ( parts [ 0 ] ) ; err != nil { return " " , " " , " " , " " , err } else { attributes = v } return attributes , scope , filter , extensions , nil case 0 : return default : err = fmt . Errorf ( " " , query ) return " " , " " , " " , " " , err } }
SplitLDAPQuery splits the query in the URL into the substituent parts.
SplitLDAPQuery splits the query in the URL into the substituent parts .