![Learning Functional Programming in Go](https://wfqqreader-1252317822.image.myqcloud.com/cover/487/36700487/b_36700487.jpg)
上QQ阅读APP看书,第一时间看更新
If Go had generics
If Go had generics, we could have written a function signature like the following to replace strings with runes, and we would not have to rewrite the inner logic:
func Map(f func(v <string>) <bool>, vs [] <string>) []<bool>
However, Go does not have generics, so we can use empty interfaces and reflection to achieve the same result.