Closed mkhstar closed 1 year ago
In it's current form, chaining Map needs to output the same type in as out. Instead you can use the more generic Map:
results := pie.Map(values, func(v string) int {
switch v {
case "1":
return 1
default:
return 2
}
})
Perhaps someone want's to put in a PR for generics changes to the chainable Map?
Thanks i might open a new pr for that. Thanks for the awesome lib
Currently i want to map though a value of one type to another ( eg. some strings and return an integer). Is it possible?