@@ -91,7 +91,6 @@ func ComposeInterface(fnList ...func(...interface{}) []interface{}) func(...inte
9191// Pipe Pipe the functions from left to right
9292func Pipe [T any ](fnList ... func (... T ) []T ) func (... T ) []T {
9393 return func (s ... T ) []T {
94-
9594 lastIndex := len (fnList ) - 1
9695 f := fnList [lastIndex ]
9796 nextFnList := fnList [:lastIndex ]
@@ -131,7 +130,6 @@ func MapIndexed[T any, R any](fn func(T, int) R, values ...T) []R {
131130
132131// Reduce Reduce the values from left to right(func(memo,val), starting value, slice)
133132func Reduce [T any , R any ](fn ReducerFunctor [T , R ], memo R , input ... T ) R {
134-
135133 for i := 0 ; i < len (input ); i ++ {
136134 memo = fn (memo , input [i ])
137135 }
@@ -141,7 +139,6 @@ func Reduce[T any, R any](fn ReducerFunctor[T, R], memo R, input ...T) R {
141139
142140// ReduceIndexed Reduce the values from left to right(func(memo,val,index), starting value, slice)
143141func ReduceIndexed [T any , R any ](fn func (R , T , int ) R , memo R , input ... T ) R {
144-
145142 for i := 0 ; i < len (input ); i ++ {
146143 memo = fn (memo , input [i ], i )
147144 }
@@ -151,9 +148,9 @@ func ReduceIndexed[T any, R any](fn func(R, T, int) R, memo R, input ...T) R {
151148
152149// Filter Filter the values by the given predicate function (predicate func, slice)
153150func Filter [T any ](fn func (T , int ) bool , input ... T ) []T {
154- var list = make ([]T , len (input ))
151+ list : = make ([]T , len (input ))
155152
156- var newLen = 0
153+ newLen : = 0
157154
158155 for i := range input {
159156 if fn (input [i ], i ) {
@@ -176,18 +173,18 @@ func Reject[T any](fn func(T, int) bool, input ...T) []T {
176173
177174// Concat Concat slices
178175func Concat [T any ](mine []T , slices ... []T ) []T {
179- var mineLen = len (mine )
180- var totalLen = mineLen
176+ mineLen : = len (mine )
177+ totalLen : = mineLen
181178
182179 for _ , slice := range slices {
183180 if slice == nil {
184181 continue
185182 }
186183
187- var targetLen = len (slice )
184+ targetLen : = len (slice )
188185 totalLen += targetLen
189186 }
190- var newOne = make ([]T , totalLen )
187+ newOne : = make ([]T , totalLen )
191188
192189 for i , item := range mine {
193190 newOne [i ] = item
@@ -199,8 +196,8 @@ func Concat[T any](mine []T, slices ...[]T) []T {
199196 continue
200197 }
201198
202- var target = slice
203- var targetLen = len (target )
199+ target : = slice
200+ targetLen : = len (target )
204201 for j , item := range target {
205202 newOne [totalIndex + j ] = item
206203 }
@@ -970,7 +967,7 @@ func PMap[T any, R any](f TransformerFunctor[T, R], option *PMapOption, list ...
970967 return make ([]R , 0 )
971968 }
972969
973- var worker = len (list )
970+ worker : = len (list )
974971 if option != nil {
975972 if option .FixedPool > 0 && option .FixedPool < worker {
976973 worker = option .FixedPool
@@ -1354,7 +1351,6 @@ func UniqBy[T any, R comparable](identify TransformerFunctor[T, R], list ...T) [
13541351
13551352// Flatten creates a new slice where one level of nested elements are unnested
13561353func Flatten [T any ](list ... []T ) []T {
1357-
13581354 result := make ([]T , 0 )
13591355
13601356 // for _, v := range list {
@@ -1942,8 +1938,7 @@ type ProductType struct {
19421938}
19431939
19441940// NilTypeDef NilType implemented by Nil determinations
1945- type NilTypeDef struct {
1946- }
1941+ type NilTypeDef struct {}
19471942
19481943// Matches Check does it match the SumType
19491944func (typeSelf SumType ) Matches (value ... interface {}) bool {
0 commit comments