MCPcopy Create free account
hub / github.com/adrg/strutil / SliceContains

Function SliceContains

internal/stringutil/stringutil.go:43–51  ·  view source on GitHub ↗

SliceContains returns true if terms contains q, or false otherwise.

(terms []string, q string)

Source from the content-addressed store, hash-verified

41
42// SliceContains returns true if terms contains q, or false otherwise.
43func SliceContains(terms []string, q string) bool {
44 for _, term := range terms {
45 if q == term {
46 return true
47 }
48 }
49
50 return false
51}

Callers 2

SliceContainsFunction · 0.92
TestSliceContainsFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestSliceContainsFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…