Skip to content

Commit 3977989

Browse files
committed
linting
1 parent fa480cd commit 3977989

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

coderd/httpmw/authorize_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ func addUser(t *testing.T, db database.Store, roles ...string) (database.User, s
146146
id, secret = randomAPIKeyParts()
147147
hashed = sha256.Sum256([]byte(secret))
148148
)
149+
if roles == nil {
150+
roles = []string{}
151+
}
149152

150153
user, err := db.InsertUser(context.Background(), database.InsertUserParams{
151154
ID: uuid.New(),

coderd/roles_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func TestListRoles(t *testing.T) {
6464
return member.ListOrganizationRoles(ctx, owner.OrganizationID)
6565
},
6666
ExpectedRoles: convertRoles(map[rbac.RoleIdentifier]bool{
67-
rbac.RoleIdentifier{Name: codersdk.RoleOrganizationAdmin, OrganizationID: owner.OrganizationID}: false,
67+
{Name: codersdk.RoleOrganizationAdmin, OrganizationID: owner.OrganizationID}: false,
6868
}),
6969
},
7070
{
@@ -93,7 +93,7 @@ func TestListRoles(t *testing.T) {
9393
return orgAdmin.ListOrganizationRoles(ctx, owner.OrganizationID)
9494
},
9595
ExpectedRoles: convertRoles(map[rbac.RoleIdentifier]bool{
96-
rbac.RoleIdentifier{Name: codersdk.RoleOrganizationAdmin, OrganizationID: owner.OrganizationID}: true,
96+
{Name: codersdk.RoleOrganizationAdmin, OrganizationID: owner.OrganizationID}: true,
9797
}),
9898
},
9999
{
@@ -122,7 +122,7 @@ func TestListRoles(t *testing.T) {
122122
return client.ListOrganizationRoles(ctx, owner.OrganizationID)
123123
},
124124
ExpectedRoles: convertRoles(map[rbac.RoleIdentifier]bool{
125-
rbac.RoleIdentifier{Name: codersdk.RoleOrganizationAdmin, OrganizationID: owner.OrganizationID}: true,
125+
{Name: codersdk.RoleOrganizationAdmin, OrganizationID: owner.OrganizationID}: true,
126126
}),
127127
},
128128
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy