Provide functional programming interface to golang
Go to file
Zane.Y 3a60729b62 Merge branch 'master' of https://github.com/ZaneYork/go-func 2017-07-19 11:46:55 +08:00
main package location 2017-07-19 11:46:28 +08:00
stream package location 2017-07-19 11:46:28 +08:00
.gitignore Initial commit 2017-07-14 20:32:36 +08:00
LICENSE Initial commit 2017-07-14 20:32:36 +08:00
README.md Update README.md 2017-07-19 11:35:46 +08:00

README.md

go-func

提供针对Golang的函数式编程接口

Provide functional programming interface in golang

使用指南:

0.拉取工具包

go get github.com/ZaneYork/go-func/stream

1.引入工具包:

import . "github.com/ZaneYork/go-func/stream"

2.使用NewSteam或者NewParallelStream函数开启数据流

3.然后追加流操作函数以修改数据

4.使用如Collect、Reduce等流终结操作函数拿到处理结果集

注意:

本工具包提供的并发数据流在处理压力较低或者单核机器上时,并发处理为负优化,请斟酌选择是否并发


Usage:

0.Clone source code

go get github.com/ZaneYork/go-func/stream

1.import package:

import . "github.com/ZaneYork/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