MustRandString returns a random string of length n.
(t *testing.T, n int)
| 12 | |
| 13 | // MustRandString returns a random string of length n. |
| 14 | func 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. |