MCPcopy Create free account
hub / github.com/buger/jsonparser / SetString

Function SetString

escape.go:268–270  ·  view source on GitHub ↗

SetString replaces the value at keys with val encoded as a JSON string. SYS-REQ-009

(data []byte, val string, keys ...string)

Source from the content-addressed store, hash-verified

266// SetString replaces the value at keys with val encoded as a JSON string.
267// SYS-REQ-009
268func SetString(data []byte, val string, keys ...string) ([]byte, error) {
269 return Set(data, Escape(val), keys...)
270}
271
272// unescape unescapes the string contained in 'in' and returns it as a slice.
273// If 'in' contains no escaped characters:

Callers 3

TestSetStringFunction · 0.85
TestSetStringRoundTripFunction · 0.85

Calls 2

SetFunction · 0.85
EscapeFunction · 0.85

Tested by 3

TestSetStringFunction · 0.68
TestSetStringRoundTripFunction · 0.68