MCPcopy Create free account
hub / github.com/algolia/cli / Contains

Function Contains

pkg/utils/utils.go:34–41  ·  view source on GitHub ↗

Contains check if a slice contains a given string

(s []string, e string)

Source from the content-addressed store, hash-verified

32
33// Contains check if a slice contains a given string
34func Contains(s []string, e string) bool {
35 for _, a := range s {
36 if a == e {
37 return true
38 }
39 }
40 return false
41}
42
43// Differences return the elements in `a` that aren't in `b`
44func Differences(a, b []string) []string {

Callers 12

SetMethod · 0.92
filterFlagSetFunction · 0.92
runStringSliceCompletionFunction · 0.92
FlagValuesMapFunction · 0.92
CheckACLsFunction · 0.92
GetIndexConfigFunction · 0.92
AskImportConfigFunction · 0.92
GetConfirmMessageFunction · 0.92
runImportCmdFunction · 0.92
TestContainsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestContainsFunction · 0.68