(buf *bytes.Buffer, quote rune, val string)
| 144 | } |
| 145 | |
| 146 | func escapeQuote(buf *bytes.Buffer, quote rune, val string) { |
| 147 | last := 0 |
| 148 | for idx, r := range val { |
| 149 | if r == quote { |
| 150 | io.WriteString(buf, val[last:idx]) |
| 151 | io.WriteString(buf, string(quote)) |
| 152 | io.WriteString(buf, string(quote)) |
| 153 | last = idx + 1 |
| 154 | } |
| 155 | } |
| 156 | io.WriteString(buf, val[last:]) |
| 157 | } |
| 158 | |
| 159 | // LiteralQuoteEscape escape string that may need characters escaped |
| 160 | // |
no outgoing calls
no test coverage detected