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

Function mustRandInt64n

coderd/workspacestats/batcher_internal_test.go:222–227  ·  view source on GitHub ↗

mustRandInt64n returns a random int64 in the range [0, n).

(t *testing.T, n int64)

Source from the content-addressed store, hash-verified

220
221// mustRandInt64n returns a random int64 in the range [0, n).
222func mustRandInt64n(t *testing.T, n int64) int64 {
223 t.Helper()
224 i, err := cryptorand.Intn(int(n))
225 require.NoError(t, err)
226 return int64(i)
227}

Callers 1

randStatsFunction · 0.85

Calls 2

IntnFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected