Skip to content

Commit d24cdd7

Browse files
committed
review
1 parent 8a7b733 commit d24cdd7

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cli/create.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ func (r *RootCmd) create() *serpent.Command {
6262
Validate: func(workspaceName string) error {
6363
err = codersdk.NameValid(workspaceName)
6464
if err != nil {
65-
return xerrors.Errorf("Workspace name %s", err)
65+
return xerrors.Errorf("workspace name: %w", err)
6666
}
6767
_, err = client.WorkspaceByOwnerAndName(inv.Context(), workspaceOwner, workspaceName, codersdk.WorkspaceOptions{})
6868
if err == nil {
69-
return xerrors.Errorf("A workspace already exists named %q!", workspaceName)
69+
return xerrors.Errorf("a workspace already exists named %q!", workspaceName)
7070
}
7171
return nil
7272
},
@@ -77,11 +77,11 @@ func (r *RootCmd) create() *serpent.Command {
7777
}
7878
err = codersdk.NameValid(workspaceName)
7979
if err != nil {
80-
return xerrors.Errorf("Workspace name %s", err)
80+
return xerrors.Errorf("workspace name: %w", err)
8181
}
8282
_, err = client.WorkspaceByOwnerAndName(inv.Context(), workspaceOwner, workspaceName, codersdk.WorkspaceOptions{})
8383
if err == nil {
84-
return xerrors.Errorf("A workspace already exists named %q!", workspaceName)
84+
return xerrors.Errorf("a workspace already exists named %q!", workspaceName)
8585
}
8686

8787
var sourceWorkspace codersdk.Workspace

cli/organizationmanage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (r *RootCmd) createOrganization() *serpent.Command {
3232

3333
err := codersdk.NameValid(orgName)
3434
if err != nil {
35-
return xerrors.Errorf("Organization name %w", err)
35+
return xerrors.Errorf("organization name: %w", err)
3636
}
3737

3838
// This check is not perfect since not all users can read all organizations.

cli/templatepush.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ func (r *RootCmd) templatePush() *serpent.Command {
5858

5959
err = codersdk.NameValid(name)
6060
if err != nil {
61-
return xerrors.Errorf("Template name %w", err)
61+
return xerrors.Errorf("template name: %w", err)
6262
}
6363

6464
if versionName != "" {
6565
err = codersdk.TemplateVersionNameValid(versionName)
6666
if err != nil {
67-
return xerrors.Errorf("Template version name %w", err)
67+
return xerrors.Errorf("template version name: %w", err)
6868
}
6969
}
7070

cli/usercreate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (r *RootCmd) userCreate() *serpent.Command {
4747
Validate: func(username string) error {
4848
err = codersdk.NameValid(username)
4949
if err != nil {
50-
return xerrors.Errorf("Username %s", err)
50+
return xerrors.Errorf("username: %w", err)
5151
}
5252
return nil
5353
},
@@ -155,7 +155,7 @@ Create a workspace `+pretty.Sprint(cliui.DefaultStyles.Code, "coder create")+`!
155155
if username.String() != "" {
156156
err := codersdk.NameValid(username.String())
157157
if err != nil {
158-
return xerrors.Errorf("Username %s", err)
158+
return xerrors.Errorf("username: %w", err)
159159
}
160160
}
161161
return nil

enterprise/cli/groupcreate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (r *RootCmd) groupCreate() *serpent.Command {
3737

3838
err = codersdk.GroupNameValid(inv.Args[0])
3939
if err != nil {
40-
return xerrors.Errorf("Group name %w", err)
40+
return xerrors.Errorf("group name: %w", err)
4141
}
4242

4343
group, err := client.CreateGroup(ctx, org.ID, codersdk.CreateGroupRequest{
@@ -70,7 +70,7 @@ func (r *RootCmd) groupCreate() *serpent.Command {
7070
if displayName.String() != "" {
7171
err := codersdk.DisplayNameValid(displayName.String())
7272
if err != nil {
73-
return xerrors.Errorf("Group display name %w", err)
73+
return xerrors.Errorf("group display name: %w", err)
7474
}
7575
}
7676
return nil

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