mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 10:50:37 -06:00
11 lines
241 B
Go
11 lines
241 B
Go
|
package util
|
||
|
|
||
|
// Reverse returns a new slice with reversed order
|
||
|
func Reverse[T comparable](input []T) []T {
|
||
|
output := make([]T, 0, len(input))
|
||
|
for i := len(input) - 1; i >= 0; i-- {
|
||
|
output = append(output, input[i])
|
||
|
}
|
||
|
return output
|
||
|
}
|