mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
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 ```
This commit is contained in:
commit
3a2fe7b8f9
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user