Equal returns true if all elements are equal.
(first, second T, rest ...T)
| 23 | |
| 24 | // Equal returns true if all elements are equal. |
| 25 | func Equal[T comparable](first, second T, rest ...T) bool { |
| 26 | if first != second { |
| 27 | return false |
| 28 | } |
| 29 | if len(rest) > 0 { |
| 30 | return Equal(second, rest[0], rest[1:]...) |
| 31 | } |
| 32 | return true |
| 33 | } |
| 34 | |
| 35 | // Reverse reverses the order of the elements in the slice. |
| 36 | func Reverse[T any](a []T) { |
no outgoing calls
no test coverage detected