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

Function SliceContains

pkg/util/util.go:12–19  ·  view source on GitHub ↗

SliceContains returns true if it finds an item in the slice that is equal to the target

(slice []T, target T)

Source from the content-addressed store, hash-verified

10
11// SliceContains returns true if it finds an item in the slice that is equal to the target
12func SliceContains[T comparable](slice []T, target T) bool {
13 for _, item := range slice {
14 if item == target {
15 return true
16 }
17 }
18 return false
19}
20
21// SliceContainsSlice returns true all items in the target are equal to items in the slice
22func SliceContainsSlice[T comparable](slice []T, target []T) bool {

Callers 12

findTenantsAndTagsFunction · 0.92
askDeploymentTargetsFunction · 0.92
PromptMissingFunction · 0.92
PromptMissingFunction · 0.92
askRunbookTargetsFunction · 0.92
askGitRunbookTargetsFunction · 0.92
filterRunbooksByTagsFunction · 0.92
IsValidKeyFunction · 0.92
SliceContainsSliceFunction · 0.85
MapCollectionWithLookupsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected