MCPcopy Index your code
hub / github.com/SpectoLabs/hoverfly / getRandomName

Function getRandomName

core/test_tools.go:57–72  ·  view source on GitHub ↗

getRandomName - provides random name for buckets. Each test case gets it's own bucket

(n int)

Source from the content-addressed store, hash-verified

55
56// getRandomName - provides random name for buckets. Each test case gets it's own bucket
57func getRandomName(n int) []byte {
58 b := make([]byte, n)
59 for i, cache, remain := n-1, src.Int63(), letterIdxMax; i >= 0; {
60 if remain == 0 {
61 cache, remain = src.Int63(), letterIdxMax
62 }
63 if idx := int(cache & letterIdxMask); idx < len(letterBytes) {
64 b[i] = letterBytes[idx]
65 i--
66 }
67 cache >>= letterIdxBits
68 remain--
69 }
70
71 return b
72}
73
74func setup() {
75 // we don't really want to see what's happening

Callers 1

InitSettingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected