MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / SliceContainsAny

Function SliceContainsAny

pkg/util/util.go:73–80  ·  view source on GitHub ↗

SliceContainsAny returns true if it finds an item in the slice where `predicate` returns true

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

Source from the content-addressed store, hash-verified

71
72// SliceContainsAny returns true if it finds an item in the slice where `predicate` returns true
73func SliceContainsAny[T comparable](slice []T, predicate func(item T) bool) bool {
74 for _, item := range slice {
75 if predicate(item) {
76 return true
77 }
78 }
79 return false
80}
81
82// SliceContainsAll returns true if it finds that all items in the slice for which `predicate` returns true
83func SliceContainsAll[T comparable](slice []T, predicate func(item T) bool) bool {

Callers 8

deployRunFunction · 0.92
createReleaseDefectRunFunction · 0.92
excludeRunFunction · 0.92
includeRunFunction · 0.92
runDbRunbookFunction · 0.92
runGitRunbookFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected