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

Function ContainsCompare

coderd/util/slice/slice.go:73–80  ·  view source on GitHub ↗
(haystack []T, needle T, equal func(a, b T) bool)

Source from the content-addressed store, hash-verified

71}
72
73func ContainsCompare[T any](haystack []T, needle T, equal func(a, b T) bool) bool {
74 for _, hay := range haystack {
75 if equal(needle, hay) {
76 return true
77 }
78 }
79 return false
80}
81
82func Contains[T comparable](haystack []T, needle T) bool {
83 return ContainsCompare(haystack, needle, func(a, b T) bool {

Callers 7

proxyWorkspaceAppMethod · 0.92
TestGroupSyncFunction · 0.92
ConvertStateFunction · 0.92
ContainsFunction · 0.85
UniqueFuncFunction · 0.85
OverlapCompareFunction · 0.85
DifferenceFuncFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGroupSyncFunction · 0.74