MCPcopy Index your code
hub / github.com/coder/coder / NewRandom

Function NewRandom

testutil/reflect.go:20–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20func NewRandom() *Random {
21 // Guaranteed to be random...
22 return &Random{
23 String: func() string { return "foo" },
24 Bool: func() bool { return true },
25 Int: func() int64 { return 500 },
26 Uint: func() uint64 { return 126 },
27 Float: func() float64 { return 3.14 },
28 Complex: func() complex128 { return 6.24 },
29 Time: func() time.Time { return time.Date(2020, 5, 2, 5, 19, 21, 30, time.UTC) },
30 }
31}
32
33// PopulateStruct does a best effort to populate a struct with random values.
34func PopulateStruct(s interface{}, r *Random) error {

Callers 1

PopulateStructFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected