Skip to content

Commit e5694cd

Browse files
committed
ldap: Use early-return pattern
1 parent 243571d commit e5694cd

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

internal/service/ldap_service.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,8 @@ func (ldap *LdapService) BindService(rebind bool) error {
143143

144144
if ldap.cert != nil {
145145
return ldap.conn.ExternalBind()
146-
} else {
147-
return ldap.conn.Bind(ldap.config.BindDN, ldap.config.BindPassword)
148146
}
147+
return ldap.conn.Bind(ldap.config.BindDN, ldap.config.BindPassword)
149148
}
150149

151150
func (ldap *LdapService) Bind(userDN string, password string) error {

0 commit comments

Comments
 (0)