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

Commitd754fd8

Browse files
committed
conditional, do not print empty string
1 parent2ac5c17 commitd754fd8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎cli/root.go‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,10 @@ func formatMultiError(from string, multi []error, opts *formatOpts) string {
11091109

11101110
// Write errors out
11111111
varstr strings.Builder
1112-
traceMsg:=fmt.Sprintf("Trace=[%s])",from)
1112+
vartraceMsgstring
1113+
iffrom!="" {
1114+
traceMsg=fmt.Sprintf("Trace=[%s])",from)
1115+
}
11131116
_,_=str.WriteString(pretty.Sprint(headLineStyle(),fmt.Sprintf("%d errors encountered: %s",len(multi),traceMsg)))
11141117
fori,errStr:=rangeerrorStrings {
11151118
// Indent each error
@@ -1159,8 +1162,10 @@ func formatCoderSDKError(from string, err *codersdk.Error, opts *formatOpts) str
11591162
_,_=str.WriteString("\n")
11601163
}
11611164
// Always include this trace. Users can ignore this.
1162-
_,_=str.WriteString(pretty.Sprint(headLineStyle(),fmt.Sprintf("Trace=[%s]",from)))
1163-
_,_=str.WriteString("\n")
1165+
iffrom!="" {
1166+
_,_=str.WriteString(pretty.Sprint(headLineStyle(),fmt.Sprintf("Trace=[%s]",from)))
1167+
_,_=str.WriteString("\n")
1168+
}
11641169

11651170
_,_=str.WriteString(pretty.Sprint(headLineStyle(),err.Message))
11661171
iferr.Helper!="" {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp