SliceEquals returns true if the slices have the same string contents, regardless of order
(slice []string, target []string)
| 34 | |
| 35 | // SliceEquals returns true if the slices have the same string contents, regardless of order |
| 36 | func 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. |
no outgoing calls
no test coverage detected