MCPcopy Create free account
hub / github.com/araddon/qlbridge / escapeQuote

Function escapeQuote

expr/stringutil.go:146–157  ·  view source on GitHub ↗
(buf *bytes.Buffer, quote rune, val string)

Source from the content-addressed store, hash-verified

144}
145
146func 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//

Callers 3

LiteralQuoteEscapeBufFunction · 0.85
StringEscapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected