refactor: refactor package with gofumpt

This commit is contained in:
ᴍᴏᴏɴD4ʀᴋ
2022-06-05 14:51:37 +08:00
parent e6aa1f0c61
commit 6d710c20e1
18 changed files with 44 additions and 72 deletions
+1 -1
View File
@@ -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]
}
+5 -7
View File
@@ -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 {