MCPcopy
hub / github.com/cortexlabs/cortex / HasString

Function HasString

pkg/lib/slices/string.go:27–34  ·  view source on GitHub ↗

HasString checks if a string slice contains a target string

(list []string, query string)

Source from the content-addressed store, hash-verified

25
26// HasString checks if a string slice contains a target string
27func HasString(list []string, query string) bool {
28 for _, elem := range list {
29 if elem == query {
30 return true
31 }
32 }
33 return false
34}
35
36// HasAnyStrings checks if a string slice contains any string from the query string slice
37func HasAnyStrings(queries []string, list []string) bool {

Callers 14

GetClusterStateFunction · 0.92
GetGhostEKSNodeGroupsMethod · 0.92
validateMethod · 0.92
doesStackExistFunction · 0.92
validateContainersFunction · 0.92
validateInterfaceMapFunction · 0.92
ValidateStringValFunction · 0.92
TestHasStringFunction · 0.92
CheckImageExistsLocallyFunction · 0.92
validateK8sComputeFunction · 0.92
nodeGroupResourcesTableFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestHasStringFunction · 0.74