summaryrefslogtreecommitdiff
path: root/internal/authentication/ldap_user_provider_test.go
diff options
context:
space:
mode:
authorAmir Zarrinkafsh <nightah@me.com>2020-04-09 11:05:17 +1000
committerGitHub <noreply@github.com>2020-04-09 11:05:17 +1000
commitde2c5836fd8a2b99260b555173fcd3023292da0f (patch)
tree6af2c37c31a8d439dbb0432ec54b8cb7f7978bd9 /internal/authentication/ldap_user_provider_test.go
parent2fed503e5e538cbbdcdc09ff52a1ddad94218400 (diff)
[Buildkite] Introduce CI linting with golangci-lint and reviewdog (#832)
* [Buildkite] Introduce CI linting with golangci-lint and reviewdog * Initial pass of golangci-lint * Add gosimple (megacheck) recommendations * Add golint recommendations * [BUGFIX] Migrate authentication traces from v3 mongodb * Add deadcode recommendations * [BUGFIX] Fix ShortTimeouts suite when run in dev workflow * Add unused recommendations * Add unparam recommendations * Disable linting on unfixable errors instead of skipping files * Adjust nolint notation for unparam * Fix ineffectual assignment to err raised by linter. * Export environment variable in agent hook * Add ineffassign recommendations * Add staticcheck recommendations * Add gocyclo recommendations * Adjust ineffassign recommendations Co-authored-by: Clement Michaud <clement.michaud34@gmail.com>
Diffstat (limited to 'internal/authentication/ldap_user_provider_test.go')
-rw-r--r--internal/authentication/ldap_user_provider_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/internal/authentication/ldap_user_provider_test.go b/internal/authentication/ldap_user_provider_test.go
index b07e811fa..fb5841d99 100644
--- a/internal/authentication/ldap_user_provider_test.go
+++ b/internal/authentication/ldap_user_provider_test.go
@@ -180,7 +180,7 @@ func TestShouldCombineUsernameFilterAndUsersFilter(t *testing.T) {
func createSearchResultWithAttributes(attributes ...*ldap.EntryAttribute) *ldap.SearchResult {
return &ldap.SearchResult{
Entries: []*ldap.Entry{
- &ldap.Entry{Attributes: attributes},
+ {Attributes: attributes},
},
}
}
@@ -227,14 +227,14 @@ func TestShouldNotCrashWhenGroupsAreNotRetrievedFromLDAP(t *testing.T) {
Search(gomock.Any()).
Return(&ldap.SearchResult{
Entries: []*ldap.Entry{
- &ldap.Entry{
+ {
DN: "uid=test,dc=example,dc=com",
Attributes: []*ldap.EntryAttribute{
- &ldap.EntryAttribute{
+ {
Name: "mail",
Values: []string{"test@example.com"},
},
- &ldap.EntryAttribute{
+ {
Name: "uid",
Values: []string{"john"},
},
@@ -288,10 +288,10 @@ func TestShouldNotCrashWhenEmailsAreNotRetrievedFromLDAP(t *testing.T) {
Search(gomock.Any()).
Return(&ldap.SearchResult{
Entries: []*ldap.Entry{
- &ldap.Entry{
+ {
DN: "uid=test,dc=example,dc=com",
Attributes: []*ldap.EntryAttribute{
- &ldap.EntryAttribute{
+ {
Name: "uid",
Values: []string{"john"},
},
@@ -346,14 +346,14 @@ func TestShouldReturnUsernameFromLDAP(t *testing.T) {
Search(gomock.Any()).
Return(&ldap.SearchResult{
Entries: []*ldap.Entry{
- &ldap.Entry{
+ {
DN: "uid=test,dc=example,dc=com",
Attributes: []*ldap.EntryAttribute{
- &ldap.EntryAttribute{
+ {
Name: "mail",
Values: []string{"test@example.com"},
},
- &ldap.EntryAttribute{
+ {
Name: "uid",
Values: []string{"John"},
},