(rng *rand.Rand)
| 49 | } |
| 50 | |
| 51 | func randomJSONString(rng *rand.Rand) interface{} { |
| 52 | if rng.Intn(2) == 0 { |
| 53 | return staticStrings[rng.Intn(len(staticStrings))] |
| 54 | } |
| 55 | result := make([]byte, 0) |
| 56 | l := rng.Intn(10) + 3 |
| 57 | for i := 0; i < l; i++ { |
| 58 | result = append(result, byte(rng.Intn(0x7f-0x20)+0x20)) |
| 59 | } |
| 60 | return string(result) |
| 61 | } |
| 62 | |
| 63 | func randomJSONNumber(rng *rand.Rand) interface{} { |
| 64 | return json.Number(fmt.Sprintf("%v", rng.ExpFloat64())) |