@@ -93,9 +93,9 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string)
9393
9494 // If it's runnable, show the useline otherwise show a version with [command]
9595 if cmd .Runnable () {
96- buf . WriteString ( fmt .Sprintf ( "```\n %s\n ```\n \n " , cmd .UseLine () ))
96+ fmt .Fprintf ( buf , "```\n %s\n ```\n \n " , cmd .UseLine ())
9797 } else {
98- buf . WriteString ( fmt .Sprintf ( "```\n %s [command] [flags]\n ```" , cmd .CommandPath ()) + " \n \n " )
98+ fmt .Fprintf ( buf , "```\n %s [command] [flags]\n ```\n \n " , cmd .CommandPath ())
9999 }
100100 }
101101
@@ -111,14 +111,14 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string)
111111 cname := name + " " + child .Name ()
112112 link := cname + ".md"
113113 link = strings .ReplaceAll (link , " " , "_" )
114- buf . WriteString ( fmt .Sprintf ( "* [%s](%s)\t - %s\n " , child .Name (), linkHandler (link ), child .Short ) )
114+ fmt .Fprintf ( buf , "* [%s](%s)\t - %s\n " , child .Name (), linkHandler (link ), child .Short )
115115 }
116116 buf .WriteString ("\n " )
117117 }
118118
119119 if len (cmd .Example ) > 0 {
120120 buf .WriteString (titlePrefix + "Examples\n \n " )
121- buf . WriteString ( fmt .Sprintf ( "```\n %s\n ```\n \n " , cmd .Example ) )
121+ fmt .Fprintf ( buf , "```\n %s\n ```\n \n " , cmd .Example )
122122 }
123123
124124 if err := printOptions (buf , cmd , name ); err != nil {
@@ -131,7 +131,7 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer, linkHandler func(string)
131131 pname := parent .CommandPath ()
132132 link := pname + ".md"
133133 link = strings .ReplaceAll (link , " " , "_" )
134- buf . WriteString ( fmt .Sprintf ( "* [%s](%s)\t - %s\n " , pname , linkHandler (link ), parent .Short ) )
134+ fmt .Fprintf ( buf , "* [%s](%s)\t - %s\n " , pname , linkHandler (link ), parent .Short )
135135 cmd .VisitParents (func (c * cobra.Command ) {
136136 if c .DisableAutoGenTag {
137137 cmd .DisableAutoGenTag = c .DisableAutoGenTag
0 commit comments