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

Function randRemoteAddr

coderd/httpmw/ratelimit_test.go:24–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22)
23
24func randRemoteAddr() string {
25 var b [4]byte
26 // nolint:gosec
27 _, _ = rand.Read(b[:])
28 // nolint:gosec
29 return fmt.Sprintf("%s:%v", net.IP(b[:]).String(), rand.Int31()%(1<<16))
30}
31
32func TestRateLimit(t *testing.T) {
33 t.Parallel()

Callers 1

TestRateLimitFunction · 0.85

Calls 2

ReadMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected