Unverified Commit 3a2fe7b8 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #61523 from dixudx/formatter_escape_percent_sign

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. escape literal percent sign when formatting **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #61503 **Special notes for your reviewer**: /assign @janetkuo @liggitt /cc @kubernetes/sig-cli-bugs **Release note**: ```release-note escape literal percent sign when formatting ```
parents 86a58202 d0dbd94d
......@@ -48,7 +48,11 @@ func (f *Formatter) Write(str string, a ...interface{}) error {
for i := 0; i < f.IndentLevel; i++ {
indent = indent + " "
}
_, err := io.WriteString(f.Writer, indent+fmt.Sprintf(str, a...)+"\n")
if len(a) > 0 {
str = fmt.Sprintf(str, a...)
}
_, err := io.WriteString(f.Writer, indent+str+"\n")
return err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment