Zane.Y 5fe6da1db1 | ||
---|---|---|
main | ||
stream | ||
.gitignore | ||
LICENSE | ||
README.md |
README.md
go-func
提供针对Golang的函数式编程接口
Provide functional programming interface in golang
使用指南:
1.引入工具包:
import . "github.com/go-func/stream"
2.使用NewSteam
或者NewParallelStream
函数开启数据流
3.然后追加流操作函数以修改数据
4.使用如Collect、Reduce等流终结操作函数拿到处理结果集
注意:本工具包提供的并发数据流在处理压力较低或者单核机器上时,并发处理为负优化,请斟酌选择是否并发
Usage:
1.import package:
import . "github.com/go-func/stream"
2.Start steam with function NewSteam
or NewParallelStream
3.Append operation function to modify element in stream
4.Terminate stream with any termination operation like Collect,Reduce,etc.
Notice:The ParallelStream provided by this toolkit may result in negative optimization when meeting low processing pressure or on a single-core machine. Please choose whether or not to use