MCPcopy
hub / github.com/coder/websocket / randInt

Function randInt

internal/examples/chat/chat_test.go:271–277  ·  view source on GitHub ↗

randInt returns a randomly generated integer between [0, max).

(max int)

Source from the content-addressed store, hash-verified

269
270// randInt returns a randomly generated integer between [0, max).
271func randInt(max int) int {
272 x, err := rand.Int(rand.Reader, big.NewInt(int64(max)))
273 if err != nil {
274 panic(fmt.Sprintf("failed to get random int: %v", err))
275 }
276 return int(x.Int64())
277}

Callers 1

randMessagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…