
上QQ阅读APP看书,第一时间看更新
Functional packages
There are many other Go packages that provide the high-order functions (HOF) that we've come to expect when writing declarative code for manipulating collections. They typically use empty interfaces and reflection, which have negative performance impacts. A well known HOF implementation is Rob Pike's Reduce package (see https://github.com/robpike/filter) where he states his preference for using for loops and clearly states, don't use this.