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

Function randomJSONBytes

property_test.go:120–127  ·  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

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

Calls 1

randomJSONValueFunction · 0.85

Tested by

no test coverage detected