Commit 6a2216a2 authored by ale's avatar ale
Browse files

Simplify a small piece of code

parent baef6675
......@@ -214,17 +214,17 @@ func newLDAPConnectionPool(uri, bindDN, bindPw string, numConns int) (*ldapConne
if err != nil {
return nil, err
}
if u.Scheme != "ldap" && u.Scheme != "ldapi" {
return nil, errors.New("unsupported scheme")
}
network := "tcp"
target := "localhost:389"
if u.Scheme == "ldap" {
switch u.Scheme {
case "ldap":
if u.Host != "" {
target = u.Host
}
} else {
case "ldapi":
target = u.Path
default:
return nil, errors.New("unsupported scheme")
}
p := &ldapConnectionPool{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment