MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / randomJSONString

Function randomJSONString

pkg/util/json/random.go:37–47  ·  view source on GitHub ↗
(rng *rand.Rand)

Source from the content-addressed store, hash-verified

35}
36
37func randomJSONString(rng *rand.Rand) interface{} {
38 if rng.Intn(2) == 0 {
39 return staticStrings[rng.Intn(len(staticStrings))]
40 }
41 result := make([]byte, 0)
42 l := rng.Intn(10) + 3
43 for i := 0; i < l; i++ {
44 result = append(result, byte(rng.Intn(0x7f-0x20)+0x20))
45 }
46 return string(result)
47}
48
49func randomJSONNumber(rng *rand.Rand) interface{} {
50 return json.Number(fmt.Sprintf("%v", rng.ExpFloat64()))

Callers 1

doRandomJSONFunction · 0.85

Calls 1

IntnMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…