@@ -18,11 +18,11 @@ func Quote(s string) string {
1818 return quoteWith (s , '"' , false , false )
1919}
2020
21- func quoteWith (s string , quote byte , ASCIIonly , graphicOnly bool ) string {
22- return string (appendQuotedWith (make ([]byte , 0 , 3 * len (s )/ 2 ), s , quote , ASCIIonly , graphicOnly ))
21+ func quoteWith (s string , quote byte , asciiOnly , graphicOnly bool ) string {
22+ return string (appendQuotedWith (make ([]byte , 0 , 3 * len (s )/ 2 ), s , quote , asciiOnly , graphicOnly ))
2323}
2424
25- func appendQuotedWith (buf []byte , s string , quote byte , ASCIIonly , graphicOnly bool ) []byte {
25+ func appendQuotedWith (buf []byte , s string , quote byte , asciiOnly , graphicOnly bool ) []byte {
2626 // Often called with big strings, so preallocate. If there's quoting,
2727 // this is conservative but still helps a lot.
2828 if cap (buf )- len (buf ) < len (s ) {
@@ -43,19 +43,19 @@ func appendQuotedWith(buf []byte, s string, quote byte, ASCIIonly, graphicOnly b
4343 buf = append (buf , lowerhex [s [0 ]& 0xF ])
4444 continue
4545 }
46- buf = appendEscapedRune (buf , r , quote , ASCIIonly , graphicOnly )
46+ buf = appendEscapedRune (buf , r , quote , asciiOnly , graphicOnly )
4747 }
4848 buf = append (buf , quote )
4949 return buf
5050}
51- func appendEscapedRune (buf []byte , r rune , quote byte , ASCIIonly , graphicOnly bool ) []byte {
51+ func appendEscapedRune (buf []byte , r rune , quote byte , asciiOnly , graphicOnly bool ) []byte {
5252 var runeTmp [utf8 .UTFMax ]byte
5353 if r == rune (quote ) || r == '\\' { // always backslashed
5454 buf = append (buf , '\\' )
5555 buf = append (buf , byte (r ))
5656 return buf
5757 }
58- if ASCIIonly {
58+ if asciiOnly {
5959 if r < utf8 .RuneSelf && strconv .IsPrint (r ) {
6060 buf = append (buf , byte (r ))
6161 return buf
0 commit comments