MCPcopy Create free account
hub / github.com/github/gh-aw / Any

Function Any

pkg/sliceutil/sliceutil.go:70–72  ·  view source on GitHub ↗

Any returns true if at least one element in the slice satisfies the predicate. Returns false for nil or empty slices. This is a pure function that does not modify the input slice.

(slice []T, predicate func(T) bool)

Source from the content-addressed store, hash-verified

68// Returns false for nil or empty slices.
69// This is a pure function that does not modify the input slice.
70func Any[T any](slice []T, predicate func(T) bool) bool {
71 return slices.ContainsFunc(slice, predicate)
72}
73
74// Deduplicate returns a new slice with duplicate elements removed.
75// The order of first occurrence is preserved.

Callers 7

ResolveWorkflowsFunction · 0.92
displayMissingSecretsFunction · 0.92
TestSpec_PublicAPI_AnyFunction · 0.85
TestAnyFunction · 0.85
TestAny_StringsFunction · 0.85
TestAny_StopsEarlyFunction · 0.85

Calls

no outgoing calls

Tested by 4

TestSpec_PublicAPI_AnyFunction · 0.68
TestAnyFunction · 0.68
TestAny_StringsFunction · 0.68
TestAny_StopsEarlyFunction · 0.68