Commit d0dbd94d authored by Di Xu's avatar Di Xu

escape literal percent sign when formatting

parent dce1b881
...@@ -48,7 +48,11 @@ func (f *Formatter) Write(str string, a ...interface{}) error { ...@@ -48,7 +48,11 @@ func (f *Formatter) Write(str string, a ...interface{}) error {
for i := 0; i < f.IndentLevel; i++ { for i := 0; i < f.IndentLevel; i++ {
indent = indent + " " 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 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