code: func (c *Conn) SearchOne(filter string, attrs []string) (*ldap.Entry, error) {
  	search := ldap.NewSearchRequest(
  		c.Config.BaseDN,
  		ldap.ScopeWholeSubtree,
  		ldap.DerefAlways,
  		1,
  		0,
  		false,
  		filter,
  		attrs,
  		nil,
  	)
  
  	result, err := c.Conn.Search(search)
  	if err != nil {
  		if e, ok := err.(*ldap.Error); ok {
  			if e.ResultCode == ldap.LDAPResultSizeLimitExceeded {
  				return nil, fmt.Errorf(`Search error "%s": more than one entries returned`, filter)
  			}
  		}
  
  		return nil, fmt.Errorf(`Search error "%s": %v`, filter, err)
  	}
  
  	if len(result.Entries) == 0 {
  		return nil, fmt.Errorf(`Search error "%s": no entries returned`, filter)
  	}
  
  	return result.Entries[0], nil
  }
docs: //SearchOne returns the single entry for the given search criteria or an error if one occurred.
  //An error is returned if exactly one entry is not returned.