func handleAdd(w ldap.ResponseWriter, m *ldap.Message) { r := m.GetAddRequest() log.Printf("Adding entry: %s", r.GetEntryDN()) //attributes values for _, attribute := range r.GetAttributes() { for _, attributeValue := range attribute.GetValues() { log.Printf("- %s:%s", attribute.GetDescription(), attributeValue) } } res := ldap.NewAddResponse(ldap.LDAPResultSuccess) w.Write(res) }