randomJSONBytes returns marshaled JSON for any random value.
(r *mathrand.Rand, depth int)
| 118 | |
| 119 | // randomJSONBytes returns marshaled JSON for any random value. |
| 120 | func 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. |
| 130 | func randomBytes(r *mathrand.Rand, max int) []byte { |
no test coverage detected