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