MCPcopy Index your code
hub / github.com/coder/coder / Contains

Function Contains

coderd/util/slice/slice.go:82–86  ·  view source on GitHub ↗
(haystack []T, needle T)

Source from the content-addressed store, hash-verified

80}
81
82func Contains[T comparable](haystack []T, needle T) bool {
83 return ContainsCompare(haystack, needle, func(a, b T) bool {
84 return a == b
85 })
86}
87
88func CountMatchingPairs[A, B any](a []A, b []B, match func(A, B) bool) int {
89 count := 0

Callers 15

ReadExperimentsFunction · 0.92
putUserStatusMethod · 0.92
TestAllResourcesFunction · 0.92
SubtestWithDBMethod · 0.92
assertSetContainsFunction · 0.92
inOptionSetFunction · 0.92
isOneShotCommandFunction · 0.92
createOIDCConfigFunction · 0.92

Calls 1

ContainsCompareFunction · 0.85

Tested by 12

TestAllResourcesFunction · 0.74
SubtestWithDBMethod · 0.74
assertSetContainsFunction · 0.74
TestGroupSyncFunction · 0.74
AssertGroupsMethod · 0.74
TestRunLoopFunction · 0.74
allJobStatusesExceptFunction · 0.74