Skip to content

Commit 1637b18

Browse files
committed
rename var
1 parent 70d3d3d commit 1637b18

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
return strings.Compare(a.Name, b.Name)
6767
})
6868

69-
var orgArg string
69+
var switchToOrg string
7070
if len(inv.Args) == 0 {
71-
// Pull orgArg from a prompt selector, rather than command line
71+
// Pull switchToOrg 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
if err != nil {
7575
return err
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-
if orgArg == "" {
83+
if switchToOrg == "" {
8484
err := conf.Organization().Delete()
8585
if err != nil && !errors.Is(err, os.ErrNotExist) {
8686
return fmt.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-
return org.Name == orgArg || org.ID.String() == orgArg
92+
return org.Name == switchToOrg || org.ID.String() == switchToOrg
9393
})
9494
if index < 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)