go-ldap sample code
Prepare environment variables to connect your LDAP server.
$ export LDAP_URL="localhost:636"
$ export LDAP_USER="cn=Manager,dc=example,dc=com"
$ export LDAP_PASSWORD="ldappassword"
$ export DN_SUFFIX="dc=example,dc=com"
Run search query.
$ go run main.go