Skip to content

Commit c6ff528

Browse files
committed
Fix formatted string error
Signed-off-by: Unnati Mishra <[email protected]> Fix formatted string error Signed-off-by: Unnati Mishra <[email protected]>
1 parent 6af6c8f commit c6ff528

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cli/pkg/kctrl/cmd/app/app_tailer.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ func (d *AppStatusDiff) PrintUpdate() (bool, string, error) {
194194
msg := "Fetch failed"
195195
errLog := d.new.Fetch.Stderr + "\n" + d.new.Fetch.Error
196196
d.statusUI.PrintLogLine(msg, errLog, true, d.new.Fetch.UpdatedAt.Time)
197-
return true, d.lastSeenDeployStdout, fmt.Errorf(msg)
197+
return true, d.lastSeenDeployStdout, fmt.Errorf("%s", msg)
198198
}
199199
d.statusUI.PrintLogLine("Fetching", d.new.Fetch.Stdout, false, d.new.Fetch.UpdatedAt.Time)
200200
d.statusUI.PrintLogLine("Fetch succeeded", "", false, d.new.Fetch.UpdatedAt.Time)
@@ -206,7 +206,7 @@ func (d *AppStatusDiff) PrintUpdate() (bool, string, error) {
206206
msg := "Template failed"
207207
errLog := d.new.Template.Stderr + "\n" + d.new.Template.Error
208208
d.statusUI.PrintLogLine(msg, errLog, true, d.new.Template.UpdatedAt.Time)
209-
return true, d.lastSeenDeployStdout, fmt.Errorf(msg)
209+
return true, d.lastSeenDeployStdout, fmt.Errorf("%s", msg)
210210
}
211211
d.statusUI.PrintLogLine("Template succeeded", "", false, d.new.Template.UpdatedAt.Time)
212212
}
@@ -226,7 +226,7 @@ func (d *AppStatusDiff) PrintUpdate() (bool, string, error) {
226226
msg := fmt.Sprintf("%s failed", ongoingOp)
227227
errLog := d.new.Deploy.Stderr + "\n" + d.new.Deploy.Error
228228
d.statusUI.PrintLogLine(msg, errLog, true, d.new.Deploy.UpdatedAt.Time)
229-
return true, d.lastSeenDeployStdout, fmt.Errorf(msg)
229+
return true, d.lastSeenDeployStdout, fmt.Errorf("%s", msg)
230230
}
231231
d.printDeployStdout(d.new.Deploy.Stdout, d.new.Deploy.UpdatedAt.Time, isDeleting)
232232
}
@@ -239,7 +239,7 @@ func (d *AppStatusDiff) PrintUpdate() (bool, string, error) {
239239
failed, errMsg := HasFailed(d.new)
240240
if failed {
241241
d.statusUI.PrintLogLine(errMsg, "", true, time.Now())
242-
return true, d.lastSeenDeployStdout, fmt.Errorf(errMsg)
242+
return true, d.lastSeenDeployStdout, fmt.Errorf("%s", errMsg)
243243
}
244244
return false, d.lastSeenDeployStdout, nil
245245
}

cli/pkg/kctrl/cmd/core/authoring_ui.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ func (uiImpl AuthoringUIImpl) PrintActionableText(text string) {
5959

6060
func (uiImpl AuthoringUIImpl) AskForText(textOpts ui.TextOpts) (string, error) {
6161
col := color.New(color.Bold)
62-
textOpts.Label = fmt.Sprintf(col.Sprint("> ")) + textOpts.Label
62+
textOpts.Label = col.Sprint("> ") + textOpts.Label
6363
return uiImpl.ui.AskForText(textOpts)
6464
}
6565

6666
func (uiImpl AuthoringUIImpl) AskForChoice(choiceOpts ui.ChoiceOpts) (int, error) {
6767
col := color.New(color.Bold)
68-
choiceOpts.Label = fmt.Sprintf(col.Sprint("> ")) + choiceOpts.Label
68+
choiceOpts.Label = (col.Sprint("> ")) + choiceOpts.Label
6969
return uiImpl.ui.AskForChoice(choiceOpts)
7070
}
7171

@@ -74,5 +74,5 @@ func (uiImpl AuthoringUIImpl) PrintHeaderText(text string) {
7474
}
7575

7676
func (uiImpl AuthoringUIImpl) PrintHeaderWithContextText(text string, context string) {
77-
uiImpl.ui.BeginLinef("%s: %s\n", color.New(color.Bold).Sprintf(text), context)
77+
uiImpl.ui.BeginLinef("%s: %s\n", color.New(color.Bold).Sprintf("%s", text), context)
7878
}

cli/pkg/kctrl/cmd/package/available/values_schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (parser *PackageValuesSchemaParser) walkOnValueSchemaProperties(docMap map[
9292
default:
9393
errMsg := fmt.Sprintf("unable to parse the value schema, the value of key named 'properties' has unsupported"+
9494
" type %v. Expected types are: [map[string]interface{}, json.RawMessage] (hint: the valuesSchema might not have any properties)", t)
95-
return fmt.Errorf(errMsg)
95+
return fmt.Errorf("%s", errMsg)
9696
}
9797

9898
// Base case two: if current level does have properties field but that interface is an empty map, we do not need to

0 commit comments

Comments
 (0)