mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-19 18:58:03 +02:00
refactor: refactor package with gofumpt
This commit is contained in:
@@ -24,7 +24,7 @@ func IntToBool[T constraints.Signed](a T) bool {
|
||||
}
|
||||
|
||||
func Reverse[T any](s []T) []T {
|
||||
var h = make([]T, len(s))
|
||||
h := make([]T, len(s))
|
||||
for i := 0; i < len(s); i++ {
|
||||
h[i] = s[len(s)-i-1]
|
||||
}
|
||||
|
||||
@@ -4,13 +4,11 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
var (
|
||||
reverseTestCases = [][]any{
|
||||
[]any{1, 2, 3, 4, 5},
|
||||
[]any{"1", "2", "3", "4", "5"},
|
||||
[]any{"1", 2, "3", "4", 5},
|
||||
}
|
||||
)
|
||||
var reverseTestCases = [][]any{
|
||||
{1, 2, 3, 4, 5},
|
||||
{"1", "2", "3", "4", "5"},
|
||||
{"1", 2, "3", "4", 5},
|
||||
}
|
||||
|
||||
func TestReverse(t *testing.T) {
|
||||
for _, ts := range reverseTestCases {
|
||||
|
||||
Reference in New Issue
Block a user