MCPcopy Index your code
hub / github.com/devfile/api / GetRandomString

Function GetRandomString

test/v200/utils/common/test_utils.go:233–243  ·  view source on GitHub ↗

GetRandomString returns a random string which is n characters long. If lower is set to true a lower case string is returned.

(n int, lower bool)

Source from the content-addressed store, hash-verified

231// GetRandomString returns a random string which is n characters long.
232// If lower is set to true a lower case string is returned.
233func GetRandomString(n int, lower bool) string {
234 b := make([]byte, n)
235 for i := range b {
236 b[i] = schemaBytes[rand.Intn(len(schemaBytes)-1)]
237 }
238 randomString := string(b)
239 if lower {
240 randomString = strings.ToLower(randomString)
241 }
242 return randomString
243}
244
245var GroupKinds = [...]schema.CommandGroupKind{schema.BuildCommandGroupKind, schema.RunCommandGroupKind, schema.TestCommandGroupKind, schema.DebugCommandGroupKind}
246

Callers 15

CreateEndpointsMethod · 0.85
addEnvFunction · 0.85
addAttributesFunction · 0.85
SetExecCommandValuesMethod · 0.85
SetApplyCommandValuesMethod · 0.85
GetRandomUniqueStringFunction · 0.85
addParentVolumeMethod · 0.85
setParentValuesMethod · 0.85
CreateParentEndpointsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected