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

Function SliceEquals

pkg/util/util.go:36–44  ·  view source on GitHub ↗

SliceEquals returns true if the slices have the same string contents, regardless of order

(slice []string, target []string)

Source from the content-addressed store, hash-verified

34
35// SliceEquals returns true if the slices have the same string contents, regardless of order
36func SliceEquals(slice []string, target []string) bool {
37 sort.Strings(slice)
38 sort.Strings(target)
39
40 if slices.Equal(slice, target) {
41 return true
42 }
43 return false
44}
45
46// SliceTransform takes an input collection, applies the transform function to each row, and returns the output.
47// Known as 'map' in most other languages or 'Select' in C# Linq.

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected