oracleRandomJSONBytes returns marshaled JSON for a random value, plus the Go value itself (so callers can walk the tree to predict sub-values).
(r *mathrand.Rand, depth int)
| 254 | // oracleRandomJSONBytes returns marshaled JSON for a random value, plus the |
| 255 | // Go value itself (so callers can walk the tree to predict sub-values). |
| 256 | func oracleRandomJSONBytes(r *mathrand.Rand, depth int) ([]byte, interface{}) { |
| 257 | v := oracleRandomJSONValue(r, depth) |
| 258 | b, err := json.Marshal(v) |
| 259 | if err != nil { |
| 260 | return []byte(`null`), nil |
| 261 | } |
| 262 | return b, v |
| 263 | } |
| 264 | |
| 265 | // --------------------------------------------------------------------------- |
| 266 | // Path picker — walks a random Go value tree to produce a path that EXISTS. |
no test coverage detected