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

Function SetString

escape.go:242–244  ·  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

240// SetString replaces the value at keys with val encoded as a JSON string.
241// SYS-REQ-009
242func SetString(data []byte, val string, keys ...string) ([]byte, error) {
243 return Set(data, Escape(val), keys...)
244}
245
246// unescape unescapes the string contained in 'in' and returns it as a slice.
247// 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