diff --git a/reverse.go b/reverse.go index e9e0d3c..a4f0b29 100644 --- a/reverse.go +++ b/reverse.go @@ -4,7 +4,7 @@ func Reverse[T any](slice []T) []T { s := make([]T, len(slice)) for i := 0; i < len(slice); i++ { ri := len(slice) - 1 - i - s[ri] = s[i] + s[ri] = slice[i] } return s }