Idiomatic Replacement for map/reduce/filter/etc

If you're still interested, the go-funk package will enable you to do map/reduce/filter etc.

This library is at the time of answering regularly updated. The previous library mentioned hasn't been updated in 4 years.

Github - Go Funk


Simple apply/filter/reduce package.

I wanted to see how hard it was to implement this sort of thing in Go, with as nice an API as I could manage. It wasn't hard.

Having written it a couple of years ago, I haven't had occasion to use it once. Instead, I just use "for" loops.

You shouldn't use it either.

Rob Pike


Follow Rob's advice. Use for loops.

Tags:

Go