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

Commit1637b18

Browse files
committed
rename var
1 parent70d3d3d commit1637b18

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎cli/organization.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ func (r *RootCmd) switchOrganization() *clibase.Cmd {
6666
returnstrings.Compare(a.Name,b.Name)
6767
})
6868

69-
varorgArgstring
69+
varswitchToOrgstring
7070
iflen(inv.Args)==0 {
71-
// PullorgArg from a prompt selector, rather than command line
71+
// PullswitchToOrg from a prompt selector, rather than command line
7272
// args.
73-
orgArg,err=promptUserSelectOrg(inv,conf,orgs)
73+
switchToOrg,err=promptUserSelectOrg(inv,conf,orgs)
7474
iferr!=nil {
7575
returnerr
7676
}
7777
}else {
78-
orgArg=inv.Args[0]
78+
switchToOrg=inv.Args[0]
7979
}
8080

8181
// If the user passes an empty string, we want to remove the organization
8282
// from the config file. This will defer to default behavior.
83-
iforgArg=="" {
83+
ifswitchToOrg=="" {
8484
err:=conf.Organization().Delete()
8585
iferr!=nil&&!errors.Is(err,os.ErrNotExist) {
8686
returnfmt.Errorf("failed to unset organization: %w",err)
@@ -89,13 +89,13 @@ func (r *RootCmd) switchOrganization() *clibase.Cmd {
8989
}else {
9090
// Find the selected org in our list.
9191
index:=slices.IndexFunc(orgs,func(org codersdk.Organization)bool {
92-
returnorg.Name==orgArg||org.ID.String()==orgArg
92+
returnorg.Name==switchToOrg||org.ID.String()==switchToOrg
9393
})
9494
ifindex<0 {
9595
// Using this error for better error message formatting
9696
err:=&codersdk.Error{
9797
Response: codersdk.Response{
98-
Message:fmt.Sprintf("Organization %q not found. Is the name correct, and are you a member of it?",orgArg),
98+
Message:fmt.Sprintf("Organization %q not found. Is the name correct, and are you a member of it?",switchToOrg),
9999
Detail:"Ensure the organization argument is correct and you are a member of it.",
100100
},
101101
Helper:fmt.Sprintf("Valid organizations you can switch to: %q",strings.Join(orgNames(orgs),", ")),

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp