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

Method Has

pkg/lib/sets/strset/strset.go:105–113  ·  view source on GitHub ↗

Has looks for the existence of items passed. It returns false if nothing is passed. For multiple items it returns true only if all of the items exist.

(items ...string)

Source from the content-addressed store, hash-verified

103// Has looks for the existence of items passed. It returns false if nothing is
104// passed. For multiple items it returns true only if all of the items exist.
105func (s Set) Has(items ...string) bool {
106 has := false
107 for _, item := range items {
108 if _, has = s[item]; !has {
109 break
110 }
111 }
112 return has
113}
114
115// HasWithPrefix checks if at least one element of the set is the prefix of any of the passed items.
116// It returns false if nothing is passed.

Callers 15

IsSubsetMethod · 0.95
ManageJobResourcesFunction · 0.95
ValidateRegionFunction · 0.45
validateMethod · 0.45
validateNodeGroupMethod · 0.45
validateSubnetsMethod · 0.45
IgnoreSpecificFilesFunction · 0.45
CopyDirOverwriteFunction · 0.45
HasAnyStringsFunction · 0.45
HasAllStringsFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestHasFunction · 0.36