MCPcopy Create free account
hub / github.com/segmentio/encoding / AppendEscape

Function AppendEscape

json/json.go:231–235  ·  view source on GitHub ↗

AppendEscape appends s to b with the string escaped as a JSON value. This will include the starting and ending quote characters, and the appropriate characters will be escaped correctly for JSON encoding.

(b []byte, s string, flags AppendFlags)

Source from the content-addressed store, hash-verified

229// This will include the starting and ending quote characters, and the
230// appropriate characters will be escaped correctly for JSON encoding.
231func AppendEscape(b []byte, s string, flags AppendFlags) []byte {
232 e := encoder{flags: flags}
233 b, _ = e.encodeString(b, unsafe.Pointer(&s))
234 return b
235}
236
237// Unescape is a convenience helper to unescape a JSON value.
238// For more control over the unescape behavior and

Callers 2

TestAppendEscapeFunction · 0.85
EscapeFunction · 0.85

Calls 1

encodeStringMethod · 0.95

Tested by 1

TestAppendEscapeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…