Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2fd5889

Browse files
committed
chore: improve variable name
1 parent4aac08d commit2fd5889

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

‎cli/sharing.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ func (r *RootCmd) shareWorkspace(orgContext *OrganizationContext) *serpent.Comma
131131
role:=groupAndRole[2]
132132

133133
varorgGroup*codersdk.Group
134-
for_,g:=rangeorgGroups {
135-
ifg.Name==groupName {
136-
orgGroup=&g
134+
for_,group:=rangeorgGroups {
135+
ifgroup.Name==groupName {
136+
orgGroup=&group
137137
break
138138
}
139139
}

‎cli/sharing_test.go‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,8 @@ func TestSharingShare(t *testing.T) {
116116
Role:codersdk.WorkspaceRoleUse,
117117
})
118118

119-
// Test that the users appear in the output
120-
outputLines:=strings.Split(out.String(),"\n")
121-
userNames:= []string{toShareWithUser1.Username,toShareWithUser2.Username}
122-
for_,username:=rangeuserNames {
123-
index:=slices.IndexFunc(outputLines,func(linestring)bool {
124-
returnstrings.Contains(line,username)
125-
})
126-
127-
assert.True(t,index!=-1,fmt.Sprintf("Expected to find the username %s in the command output: %s",username,out.String()))
128-
}
119+
assert.Contains(t,out.String(),toShareWithUser1.Username)
120+
assert.Contains(t,out.String(),toShareWithUser2.Username)
129121
})
130122

131123
t.Run("ShareWithUsers_Roles",func(t*testing.T) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp