MCPcopy
hub / github.com/redspread/spread / randomString

Function randomString

pkg/input/dir/source_test.go:374–381  ·  view source on GitHub ↗
(strlen int)

Source from the content-addressed store, hash-verified

372}
373
374func randomString(strlen int) string {
375 const chars = "abcdefghijklmnopqrstuvwxyz0123456789"
376 result := make([]byte, strlen)
377 for i := 0; i < strlen; i++ {
378 result[i] = chars[rand.Intn(len(chars))]
379 }
380 return string(result)
381}
382
383// testRandomExtension selects and returns one of the "ObjectExtensions" at random
384func testRandomExtension() string {

Callers 4

TestSourceContainersDirFunction · 0.70
createSecretFunction · 0.70
testRandomObjectsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected