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)
| 229 | // This will include the starting and ending quote characters, and the |
| 230 | // appropriate characters will be escaped correctly for JSON encoding. |
| 231 | func 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 |
searching dependent graphs…