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

Commit0d01d02

Browse files
authored
fix: remove unnecessary newlines from the end of cli output (#9068)
`Infof` already adds a newline, so we don't need to as well!
1 parent9a13814 commit0d01d02

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

‎cli/exp_scaletest.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ func (r *RootCmd) scaletestCleanup() *clibase.Cmd {
427427

428428
cliui.Errorf(inv.Stderr,"Found %d scaletest workspaces\n",len(workspaces))
429429
iflen(workspaces)!=0 {
430-
cliui.Infof(inv.Stdout,"Deleting scaletest workspaces..."+"\n")
430+
cliui.Infof(inv.Stdout,"Deleting scaletest workspaces...")
431431
harness:=harness.NewTestHarness(cleanupStrategy.toStrategy(), harness.ConcurrentExecutionStrategy{})
432432

433433
fori,w:=rangeworkspaces {
@@ -443,7 +443,7 @@ func (r *RootCmd) scaletestCleanup() *clibase.Cmd {
443443
returnxerrors.Errorf("run test harness to delete workspaces (harness failure, not a test failure): %w",err)
444444
}
445445

446-
cliui.Infof(inv.Stdout,"Done deleting scaletest workspaces:"+"\n")
446+
cliui.Infof(inv.Stdout,"Done deleting scaletest workspaces:")
447447
res:=harness.Results()
448448
res.PrintText(inv.Stderr)
449449

@@ -460,7 +460,7 @@ func (r *RootCmd) scaletestCleanup() *clibase.Cmd {
460460

461461
cliui.Errorf(inv.Stderr,"Found %d scaletest users\n",len(users))
462462
iflen(users)!=0 {
463-
cliui.Infof(inv.Stdout,"Deleting scaletest users..."+"\n")
463+
cliui.Infof(inv.Stdout,"Deleting scaletest users...")
464464
harness:=harness.NewTestHarness(cleanupStrategy.toStrategy(), harness.ConcurrentExecutionStrategy{})
465465

466466
fori,u:=rangeusers {
@@ -479,7 +479,7 @@ func (r *RootCmd) scaletestCleanup() *clibase.Cmd {
479479
returnxerrors.Errorf("run test harness to delete users (harness failure, not a test failure): %w",err)
480480
}
481481

482-
cliui.Infof(inv.Stdout,"Done deleting scaletest users:"+"\n")
482+
cliui.Infof(inv.Stdout,"Done deleting scaletest users:")
483483
res:=harness.Results()
484484
res.PrintText(inv.Stderr)
485485

‎cli/gitaskpass.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ func (r *RootCmd) gitAskpass() *clibase.Cmd {
5151
}
5252
iftoken.URL!="" {
5353
iferr:=openURL(inv,token.URL);err==nil {
54-
cliui.Infof(inv.Stderr,"Your browser has been opened to authenticate with Git:\n\n%s\n",token.URL)
54+
cliui.Infof(inv.Stderr,"Your browser has been opened to authenticate with Git:\n%s",token.URL)
5555
}else {
56-
cliui.Infof(inv.Stderr,"Open the following URL to authenticate with Git:\n\n%s\n",token.URL)
56+
cliui.Infof(inv.Stderr,"Open the following URL to authenticate with Git:\n%s",token.URL)
5757
}
5858

5959
forr:=retry.New(250*time.Millisecond,10*time.Second);r.Wait(ctx); {
6060
token,err=client.GitAuth(ctx,host,true)
6161
iferr!=nil {
6262
continue
6363
}
64-
cliui.Infof(inv.Stderr,"You've been authenticated with Git!\n")
64+
cliui.Infof(inv.Stderr,"You've been authenticated with Git!")
6565
break
6666
}
6767
}

‎cli/publickey.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ func (r *RootCmd) publickey() *clibase.Cmd {
4545

4646
cliui.Infof(inv.Stdout,
4747
"This is your public key for using "+cliui.DefaultStyles.Field.Render("git")+" in "+
48-
"Coder. All clones with SSH will be authenticated automatically 🪄.\n\n",
48+
"Coder. All clones with SSH will be authenticated automatically 🪄.",
4949
)
50-
cliui.Infof(inv.Stdout,cliui.DefaultStyles.Code.Render(strings.TrimSpace(key.PublicKey))+"\n\n")
51-
cliui.Infof(inv.Stdout,"Add to GitHub and GitLab:"+"\n")
52-
cliui.Infof(inv.Stdout,cliui.DefaultStyles.Prompt.String()+"https://github.com/settings/ssh/new"+"\n")
53-
cliui.Infof(inv.Stdout,cliui.DefaultStyles.Prompt.String()+"https://gitlab.com/-/profile/keys"+"\n")
50+
cliui.Infof(inv.Stdout,cliui.DefaultStyles.Code.Render(strings.TrimSpace(key.PublicKey))+"\n")
51+
cliui.Infof(inv.Stdout,"Add to GitHub and GitLab:")
52+
cliui.Infof(inv.Stdout,cliui.DefaultStyles.Prompt.String()+"https://github.com/settings/ssh/new")
53+
cliui.Infof(inv.Stdout,cliui.DefaultStyles.Prompt.String()+"https://gitlab.com/-/profile/keys")
5454

5555
returnnil
5656
},

‎cli/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
10301030
deferwg.Done()
10311031

10321032
ifok,_:=inv.ParsedFlags().GetBool(varVerbose);ok {
1033-
cliui.Infof(inv.Stdout,"Shutting down provisioner daemon %d...\n",id)
1033+
cliui.Infof(inv.Stdout,"Shutting down provisioner daemon %d...",id)
10341034
}
10351035
err:=shutdownWithTimeout(provisionerDaemon.Shutdown,5*time.Second)
10361036
iferr!=nil {
@@ -1043,7 +1043,7 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
10431043
return
10441044
}
10451045
ifok,_:=inv.ParsedFlags().GetBool(varVerbose);ok {
1046-
cliui.Infof(inv.Stdout,"Gracefully shut down provisioner daemon %d\n",id)
1046+
cliui.Infof(inv.Stdout,"Gracefully shut down provisioner daemon %d",id)
10471047
}
10481048
}()
10491049
}

‎cli/server_createadminuser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func (r *RootCmd) newCreateAdminUserCommand() *clibase.Cmd {
5151
defercancel()
5252

5353
ifnewUserDBURL=="" {
54-
cliui.Infof(inv.Stdout,"Using built-in PostgreSQL (%s)\n",cfg.PostgresPath())
54+
cliui.Infof(inv.Stdout,"Using built-in PostgreSQL (%s)",cfg.PostgresPath())
5555
url,closePg,err:=startBuiltinPostgres(ctx,cfg,logger)
5656
iferr!=nil {
5757
returnerr

‎cli/speedtest.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,14 @@ func (r *RootCmd) speedtest() *clibase.Cmd {
8585
}
8686
peer:=status.Peer[status.Peers()[0]]
8787
if!p2p&&direct {
88-
cliui.Infof(inv.Stdout,"Waiting for a direct connection... (%dms via %s)\n",dur.Milliseconds(),peer.Relay)
88+
cliui.Infof(inv.Stdout,"Waiting for a direct connection... (%dms via %s)",dur.Milliseconds(),peer.Relay)
8989
continue
9090
}
9191
via:=peer.Relay
9292
ifvia=="" {
9393
via="direct"
9494
}
95-
cliui.Infof(inv.Stdout,"%dms via %s\n",dur.Milliseconds(),via)
95+
cliui.Infof(inv.Stdout,"%dms via %s",dur.Milliseconds(),via)
9696
break
9797
}
9898
}else {
@@ -107,7 +107,7 @@ func (r *RootCmd) speedtest() *clibase.Cmd {
107107
default:
108108
returnxerrors.Errorf("invalid direction: %q",direction)
109109
}
110-
cliui.Infof(inv.Stdout,"Starting a %ds %s test...\n",int(duration.Seconds()),tsDir)
110+
cliui.Infof(inv.Stdout,"Starting a %ds %s test...",int(duration.Seconds()),tsDir)
111111
results,err:=conn.Speedtest(ctx,tsDir,duration)
112112
iferr!=nil {
113113
returnerr

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp