Make linter happy

This commit is contained in:
世界 2022-06-28 22:16:48 +08:00
parent aa7007a947
commit beeeba3388
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
12 changed files with 26 additions and 33 deletions

View file

@ -35,7 +35,7 @@ func Contains[T comparable](arr []T, target T) bool {
}
func Map[T any, N any](arr []T, block func(it T) N) []N {
var retArr []N
retArr := make([]N, 0, len(arr))
for index := range arr {
retArr = append(retArr, block(arr[index]))
}
@ -43,7 +43,7 @@ func Map[T any, N any](arr []T, block func(it T) N) []N {
}
func MapIndexed[T any, N any](arr []T, block func(index int, it T) N) []N {
var retArr []N
retArr := make([]N, 0, len(arr))
for index := range arr {
retArr = append(retArr, block(index, arr[index]))
}