thoas / go-funk

A modern Go utility library which provides helpers (map, find, contains, filter, ...)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use external param inside Filter method

xoco70 opened this issue · comments

Hi,

Inside the Filter method, I need to compare with a param defined outside anonymous method funk.Filter.

for _, repartition := range repartitions {
		operationsGroupByRepartition := funk.Filter(operations, func(operation models.OperationFromMetadata) bool {
			return operation.Repartition == repartition.Name()
		}).([]models.OperationFromMetadata)
}

so repartition is nil.

Is there anything I could do about it ?

it was my mistake, sorry !