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

Function MustRandString

testutil/rand.go:14–19  ·  view source on GitHub ↗

MustRandString returns a random string of length n.

(t *testing.T, n int)

Source from the content-addressed store, hash-verified

12
13// MustRandString returns a random string of length n.
14func MustRandString(t *testing.T, n int) string {
15 t.Helper()
16 s, err := cryptorand.String(n)
17 require.NoError(t, err)
18 return s
19}
20
21// RandomIPv6 returns a random IPv6 address in the 2001:db8::/32 range.
22// 2001:db8::/32 is reserved for documentation and example code.

Callers 7

CreateTestOAuth2AppFunction · 0.92
TestServerDBCryptFunction · 0.92
genDataFunction · 0.92
fakeContainerFunction · 0.92

Calls 2

StringFunction · 0.92
HelperMethod · 0.65

Tested by 6

TestServerDBCryptFunction · 0.74
genDataFunction · 0.74
fakeContainerFunction · 0.74