https://github.com/robpike/filterI 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 上面的话,我忍不住笑了,大神的意思是:
“map / reduce / filter 这些玩意真的有那么好吗,好吧,我试着写一个库来实现这些东西,Go 实现起来就是小菜一碟。
但是,我实现了又怎么了,这些代码一动不动的躺在这里好几年了,我他妈根本没有场合去使用它!我平时用用 for 就行了,我证明了这些东西没用,所以你们也不要用了。”
可。。可是 Pike 大神,你平时写的都是 infrastructure,并不理解我们写业务写 CURD 的痛。。
权当供大家一笑