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

Function randomJSONBytes

property_test.go:121–128  ·  view source on GitHub ↗

randomJSONBytes returns marshaled JSON for any random value.

(r *mathrand.Rand, depth int)

Source from the content-addressed store, hash-verified

119
120// randomJSONBytes returns marshaled JSON for any random value.
121func randomJSONBytes(r *mathrand.Rand, depth int) []byte {
122 v := randomJSONValue(r, depth)
123 b, err := json.Marshal(v)
124 if err != nil {
125 return []byte(`null`)
126 }
127 return b
128}
129
130// randomBytes returns arbitrary (usually non-JSON) bytes from a seeded RNG.
131func randomBytes(r *mathrand.Rand, max int) []byte {

Calls 1

randomJSONValueFunction · 0.85

Tested by

no test coverage detected