MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / ConvertToJSONString

Function ConvertToJSONString

base/util.go:199–202  ·  view source on GitHub ↗

ConvertToJSONString takes a string, and returns a JSON string, with any illegal characters escaped.

(s string)

Source from the content-addressed store, hash-verified

197
198// ConvertToJSONString takes a string, and returns a JSON string, with any illegal characters escaped.
199func ConvertToJSONString(s string) string {
200 b, _ := JSONMarshal(s)
201 return string(b)
202}
203
204// Concatenates and merges multiple string arrays into one, discarding all duplicates (including
205// duplicates within a single array.) Ordering is preserved.

Callers 10

writeStatusMethod · 0.92
handlePutAttachmentMethod · 0.92
handlePutDocMethod · 0.92
handlePostDocMethod · 0.92
handleDeleteDocMethod · 0.92
handlePutLocalDocMethod · 0.92
TestJSONStringUtilsFunction · 0.85
BenchmarkJSONStringUtilsFunction · 0.85

Calls 1

JSONMarshalFunction · 0.70

Tested by 2

TestJSONStringUtilsFunction · 0.68
BenchmarkJSONStringUtilsFunction · 0.68