From c3fad62d8cccde05483f4d94028bc71441e52e5a Mon Sep 17 00:00:00 2001 From: dudaodong Date: Mon, 17 Apr 2023 13:53:47 +0800 Subject: [PATCH] doc: update stream package document --- README.md | 94 ++++++++++++++++++++++++++++++++-- README_zh-CN.md | 118 ++++++++++++++++++++++++++++++++++++------- docs/stream_zh-CN.md | 4 +- stream/stream.go | 2 +- 4 files changed, 193 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 03b34f3..a8134be 100644 --- a/README.md +++ b/README.md @@ -1063,7 +1063,91 @@ import "github.com/duke-git/lancet/v2/slice" [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice.md#KeyBy)] [[play](https://go.dev/play/p/uXod2LWD1Kg)] -### 17. Structs package provides several high level functions to manipulate struct, tag, and field. +### 17. Stream package implements a sequence of elements supporting sequential and operations. this package is an experiment to explore if stream in go can work as the way java does. its function is very limited. + +```go +import "github.com/duke-git/lancet/v2/stream" +``` + +#### Function list: + +- **Of** : creates a stream whose elements are the specified values. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Of)] + [[play](https://go.dev/play/p/jI6_iZZuVFE)] +- **FromSlice** : creates a stream from slice. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#FromSlice)] + [[play](https://go.dev/play/p/wywTO0XZtI4)] +- **FromChannel** : creates a stream from channel. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#FromChannel)] + [[play](https://go.dev/play/p/9TZYugGMhXZ)] +- **FromRange** : creates a number stream from start to end. both start and end are included. [start, end] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#FromRange)] + [[play](https://go.dev/play/p/9Ex1-zcg-B-)] +- **Generate** : creates a stream where each element is generated by the provided generater function. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Generate)] + [[play](https://go.dev/play/p/rkOWL1yA3j9)] +- **Concat** : creates a lazily concatenated stream whose elements are all the elements of the first stream followed by all the elements of the second stream. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Concat)] + [[play](https://go.dev/play/p/HM4OlYk_OUC)] +- **Distinct** : creates returns a stream that removes the duplicated items. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Distinct)] + [[play](https://go.dev/play/p/eGkOSrm64cB)] +- **Filter** : returns a stream consisting of the elements of this stream that match the given predicate. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Filter)] + [[play](https://go.dev/play/p/MFlSANo-buc)] +- **Map** : returns a stream consisting of the elements of this stream that apply the given function to elements of stream. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Map)] + [[play](https://go.dev/play/p/OtNQUImdYko)] +- **Peek** : returns a stream consisting of the elements of this stream, additionally performing the provided action on each element as elements are consumed from the resulting stream. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Peek)] + [[play](https://go.dev/play/p/u1VNzHs6cb2)] +- **Skip** : returns a stream consisting of the remaining elements of this stream after discarding the first n elements of the stream. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Skip)] + [[play](https://go.dev/play/p/fNdHbqjahum)] +- **Limit** : returns a stream consisting of the elements of this stream, truncated to be no longer than maxSize in length. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Limit)] + [[play](https://go.dev/play/p/qsO4aniDcGf)] +- **Reverse** : returns a stream whose elements are reverse order of given stream. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Reverse)] + [[play](https://go.dev/play/p/A8_zkJnLHm4)] +- **Range** : returns a stream whose elements are in the range from start(included) to end(excluded) original stream. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Range)] + [[play](https://go.dev/play/p/indZY5V2f4j)] +- **Sorted** : returns a stream consisting of the elements of this stream, sorted according to the provided less function. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Sorted)] + [[play](https://go.dev/play/p/XXtng5uonFj)] +- **ForEach** : performs an action for each element of this stream. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#ForEach)] + [[play](https://go.dev/play/p/Dsm0fPqcidk)] +- **Reduce** : performs a reduction on the elements of this stream, using an associative accumulation function, and returns an Optional describing the reduced value, if any. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Reduce)] + [[play](https://go.dev/play/p/6uzZjq_DJLU)] +- **FindFirst** : returns the first element of this stream and true, or zero value and false if the stream is empty. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#FindFirst)] + [[play](https://go.dev/play/p/9xEf0-6C1e3)] +- **Max** : returns the maximum element of this stream according to the provided less function. less fuction: a > b + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Max)] + [[play](https://go.dev/play/p/fm-1KOPtGzn)] +- **Min** : returns the minimum element of this stream according to the provided less function. less fuction: a < b + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Min)] + [[play](https://go.dev/play/p/vZfIDgGNRe_0)] +- **AllMatch** : returns whether all elements of this stream match the provided predicate. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#AllMatch)] + [[play](https://go.dev/play/p/V5TBpVRs-Cx)] +- **AnyMatch** : returns whether any elements of this stream match the provided predicate. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#AnyMatch)] + [[play](https://go.dev/play/p/PTCnWn4OxSn)] +- **NoneMatch** : returns whether no elements of this stream match the provided predicate. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#NoneMatch)] + [[play](https://go.dev/play/p/iWS64pL1oo3)] +- **Count** : returns the count of elements in the stream. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#Count)] + [[play](https://go.dev/play/p/r3koY6y_Xo-)] +- **ToSlice** : returns the elements in the stream. + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream.md#ToSlice)] + [[play](https://go.dev/play/p/jI6_iZZuVFE)] + +### 18. Structs package provides several high level functions to manipulate struct, tag, and field. ```go import "github.com/duke-git/lancet/v2/structs" @@ -1096,7 +1180,7 @@ import "github.com/duke-git/lancet/v2/structs" - **IsSlice** : check if the field is a slice [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field.md#IsSlice)] -### 18. Strutil package contains some functions to manipulate string. +### 19. Strutil package contains some functions to manipulate string. ```go import "github.com/duke-git/lancet/v2/strutil" @@ -1176,7 +1260,7 @@ import "github.com/duke-git/lancet/v2/strutil" [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil.md#RemoveNonPrintable)] [[play](https://go.dev/play/p/og47F5x_jTZ)] -### 19. System package contain some functions about os, runtime, shell command. +### 20. System package contain some functions about os, runtime, shell command. ```go import "github.com/duke-git/lancet/v2/system" @@ -1212,7 +1296,7 @@ import "github.com/duke-git/lancet/v2/system" [[doc](https://github.com/duke-git/lancet/blob/main/docs/system.md#GetOsBits)] [[play](https://go.dev/play/p/ml-_XH3gJbW)] -### 20. Validator package contains some functions for data validation. +### 21. Validator package contains some functions for data validation. ```go import "github.com/duke-git/lancet/v2/validator" @@ -1317,7 +1401,7 @@ import "github.com/duke-git/lancet/v2/validator" [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator.md#IsPrintable)] [[play](https://go.dev/play/p/Pe1FE2gdtTP)] -### 21. xerror package implements helpers for errors. +### 22. xerror package implements helpers for errors. ```go import "github.com/duke-git/lancet/v2/xerror" diff --git a/README_zh-CN.md b/README_zh-CN.md index eaf5f1a..a890e93 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -554,17 +554,17 @@ import "github.com/duke-git/lancet/v2/formatter" - **Comma** : 用逗号每隔 3 位分割数字/字符串,支持前缀添加符号。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#Comma)] [[play](https://go.dev/play/p/eRD5k2vzUVX)] -- **Pretty** : 返回pretty JSON字符串。 +- **Pretty** : 返回 pretty JSON 字符串。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#Pretty)] -- **PrettyToWriter** : Pretty encode数据到writer。 +- **PrettyToWriter** : Pretty encode 数据到 writer。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#PrettyToWriter)] -- **DecimalBytes** : 返回十进制标准(以1000为基数)下的可读字节单位字符串。precision参数指定小数点后的位数,默认为4。 +- **DecimalBytes** : 返回十进制标准(以 1000 为基数)下的可读字节单位字符串。precision 参数指定小数点后的位数,默认为 4。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#DecimalBytes)] -- **BinaryBytes** : 返回binary标准(以1024为基数)下的可读字节单位字符串。precision参数指定小数点后的位数,默认为4。 +- **BinaryBytes** : 返回 binary 标准(以 1024 为基数)下的可读字节单位字符串。precision 参数指定小数点后的位数,默认为 4。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#BinaryBytes)] -- **ParseDecimalBytes** : 将字节单位字符串转换成其所表示的字节数(以1000为基数)。 +- **ParseDecimalBytes** : 将字节单位字符串转换成其所表示的字节数(以 1000 为基数)。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#ParseDecimalBytes)] -- **ParseBinaryBytes** : 将字节单位字符串转换成其所表示的字节数(以1024为基数)。 +- **ParseBinaryBytes** : 将字节单位字符串转换成其所表示的字节数(以 1024 为基数)。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/formatter_zh-CN.md#ParseBinaryBytes)] ### 10. function 函数包控制函数执行流程,包含部分函数式编程。 @@ -611,7 +611,7 @@ import "github.com/duke-git/lancet/v2/maputil" #### 函数列表: -- **MapTo** : 快速将map或者其他类型映射到结构体或者指定类型。 +- **MapTo** : 快速将 map 或者其他类型映射到结构体或者指定类型。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#MapTo)] - **ForEach** : 对 map 中的每对 key 和 value 执行 iteratee 函数。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/maputil_zh-CN.md#ForEach)] @@ -985,12 +985,12 @@ import "github.com/duke-git/lancet/v2/slice" - **Reverse** : 反转切片中的元素顺序。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Reverse)] [[play](https://go.dev/play/p/8uI8f1lwNrQ)] -- **Reducedeprecated** : 将切片中的元素依次运行iteratee函数,返回运行结果。(废弃:建议使用ReduceBy) +- **Reducedeprecated** : 将切片中的元素依次运行 iteratee 函数,返回运行结果。(废弃:建议使用 ReduceBy) [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Reduce)] [[play](https://go.dev/play/p/_RfXJJWIsIm)] -- **ReduceBy** : 对切片元素执行reduce操作。 +- **ReduceBy** : 对切片元素执行 reduce 操作。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ReduceBy)] -- **ReduceRight** : 类似ReduceBy操作,迭代切片元素顺序从右至左。 +- **ReduceRight** : 类似 ReduceBy 操作,迭代切片元素顺序从右至左。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#ReduceRight)] - **Replace** : 返回切片的副本,其中前 n 个不重叠的 old 替换为 new。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#Replace)] @@ -1062,7 +1062,91 @@ import "github.com/duke-git/lancet/v2/slice" [[doc](https://github.com/duke-git/lancet/blob/main/docs/slice_zh-CN.md#KeyBy)] [[play](https://go.dev/play/p/uXod2LWD1Kg)] -### 17. structs 提供操作 struct, tag, field 的相关函数。 +### 17. Stream 流,该包仅验证简单的 stream 实现,功能有限。 + +```go +import "github.com/duke-git/lancet/v2/stream" +``` + +#### Function list: + +- **Of** : 创建元素为指定值的 stream。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Of)] + [[play](https://go.dev/play/p/jI6_iZZuVFE)] +- **FromSlice** : 从切片创建 stream。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#FromSlice)] + [[play](https://go.dev/play/p/wywTO0XZtI4)] +- **FromChannel** : 从通道创建 stream。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#FromChannel)] + [[play](https://go.dev/play/p/9TZYugGMhXZ)] +- **FromRange** : 指定一个数字范围创建 stream, 范围两端点值都包括在内。. [start, end] + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#FromRange)] + [[play](https://go.dev/play/p/9Ex1-zcg-B-)] +- **Generate** : 创建一个 stream,其中每个元素都由提供的生成器函数生成。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Generate)] + [[play](https://go.dev/play/p/rkOWL1yA3j9)] +- **Concat** : 创建一个延迟连接 stream,其元素是第一个 stream 的所有元素,后跟第二个 stream 的全部元素。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Concat)] + [[play](https://go.dev/play/p/HM4OlYk_OUC)] +- **Distinct** : 创建并返回一个 stream,用于删除重复的项。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Distinct)] + [[play](https://go.dev/play/p/eGkOSrm64cB)] +- **Filter** : 返回一个通过判定函数的 stream。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Filter)] + [[play](https://go.dev/play/p/MFlSANo-buc)] +- **Map** : 返回一个 stream,该 stream 由将给定函数应用于源 stream 元素的元素组成。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Map)] + [[play](https://go.dev/play/p/OtNQUImdYko)] +- **Peek** : 返回一个由源 stream 的元素组成的 stream,并在从生成的 stream 中消耗元素时对每个元素执行所提供的操作。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Peek)] + [[play](https://go.dev/play/p/u1VNzHs6cb2)] +- **Skip** : 在丢弃 stream 的前 n 个元素后,返回由源 stream 的其余元素组成的 stream。如果此 stream 包含的元素少于 n 个,则将返回一个空 stream。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Skip)] + [[play](https://go.dev/play/p/fNdHbqjahum)] +- **Limit** : 返回由源 stream 的元素组成的 stream,该 stream 被截断为长度不超过 maxSize。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Limit)] + [[play](https://go.dev/play/p/qsO4aniDcGf)] +- **Reverse** : 返回元素与源 stream 的顺序相反的 stream。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Reverse)] + [[play](https://go.dev/play/p/A8_zkJnLHm4)] +- **Range** : 返回一个 stream,该 stream 的元素在从源 stream 的开始(包含)到结束(排除)的范围内。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Range)] + [[play](https://go.dev/play/p/indZY5V2f4j)] +- **Sorted** : 返回一个 stream,该 stream 由源 stream 的元素组成,并根据提供的 less 函数进行排序。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Sorted)] + [[play](https://go.dev/play/p/XXtng5uonFj)] +- **ForEach** : 对 stream 的每个元素执行一个操作。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#ForEach)] + [[play](https://go.dev/play/p/Dsm0fPqcidk)] +- **Reduce** : 使用关联累加函数对 stream 的元素执行 reduce 操作,并 reduce 操作结果(如果有)。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Reduce)] + [[play](https://go.dev/play/p/6uzZjq_DJLU)] +- **FindFirst** : 返回此 stream 的第一个元素和 true,如果 stream 为空,则返回零值和 false。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#FindFirst)] + [[play](https://go.dev/play/p/9xEf0-6C1e3)] +- **Max** : 根据提供的 less 函数返回 stream 的最大元素。less 函数: a > b + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Max)] + [[play](https://go.dev/play/p/fm-1KOPtGzn)] +- **Min** : 根据提供的 less 函数返回 stream 的最小元素。less 函数: a < b + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Min)] + [[play](https://go.dev/play/p/vZfIDgGNRe_0)] +- **AllMatch** : 判断 stream 的所有元素是否全部匹配指定判定函数。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#AllMatch)] + [[play](https://go.dev/play/p/V5TBpVRs-Cx)] +- **AnyMatch** : 判断 stream 是否包含匹配指定判定函数的元素。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#AnyMatch)] + [[play](https://go.dev/play/p/PTCnWn4OxSn)] +- **NoneMatch** : 判断 stream 的元素是否全部不匹配指定的判定函数。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#NoneMatch)] + [[play](https://go.dev/play/p/iWS64pL1oo3)] +- **Count** : 返回 stream 中元素的数量。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#Count)] + [[play](https://go.dev/play/p/r3koY6y_Xo-)] +- **ToSlice** : 返回 stream 中的元素切片。 + [[doc](https://github.com/duke-git/lancet/blob/main/docs/stream_zh-CN.md#ToSlice)] + [[play](https://go.dev/play/p/jI6_iZZuVFE)] + +### 18. structs 提供操作 struct, tag, field 的相关函数。 ```go import "github.com/duke-git/lancet/v2/structs" @@ -1097,7 +1181,7 @@ import "github.com/duke-git/lancet/v2/structs" - **IsSlice** : 判断属性是否是切片。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/structs/field_zh-CN.md#IsSlice)] -### 18. strutil 包含字符串处理的相关函数。 +### 19. strutil 包含字符串处理的相关函数。 ```go import "github.com/duke-git/lancet/v2/strutil" @@ -1178,7 +1262,7 @@ import "github.com/duke-git/lancet/v2/strutil" [[doc](https://github.com/duke-git/lancet/blob/main/docs/strutil_zh-CN.md#RemoveNonPrintable)] [[play](https://go.dev/play/p/og47F5x_jTZ)] -### 19. system 包含 os, runtime, shell command 的相关函数。 +### 20. system 包含 os, runtime, shell command 的相关函数。 ```go import "github.com/duke-git/lancet/v2/system" @@ -1214,7 +1298,7 @@ import "github.com/duke-git/lancet/v2/system" [[doc](https://github.com/duke-git/lancet/blob/main/docs/system_zh-CN#GetOsBits)] [[play](https://go.dev/play/p/ml-_XH3gJbW)] -### 20. validator 验证器包,包含常用字符串格式验证函数。 +### 21. validator 验证器包,包含常用字符串格式验证函数。 ```go import "github.com/duke-git/lancet/v2/validator" @@ -1288,10 +1372,10 @@ import "github.com/duke-git/lancet/v2/validator" - **IsIntStr** : 验证字符串是否是可以转换为整数。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIntStr)] [[play](https://go.dev/play/p/jQRtFv-a0Rk)] -- **IsIp** : 验证字符串是否是ip地址。 +- **IsIp** : 验证字符串是否是 ip 地址。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIp)] [[play](https://go.dev/play/p/FgcplDvmxoD)] -- **IsIpV4** : 验证字符串是否是ipv4地址。 +- **IsIpV4** : 验证字符串是否是 ipv4 地址。 [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsIpV4)] [[play](https://go.dev/play/p/zBGT99EjaIu)] - **IsIpV6** : 验证字符串是否是 ipv6 地址。 @@ -1319,7 +1403,7 @@ import "github.com/duke-git/lancet/v2/validator" [[doc](https://github.com/duke-git/lancet/blob/main/docs/validator_zh-CN.md#IsPrintable)] [[play](https://go.dev/play/p/Pe1FE2gdtTP)] -### 21. xerror 包实现一些错误处理函数 +### 22. xerror 包实现一些错误处理函数 ```go import "github.com/duke-git/lancet/v2/xerror" diff --git a/docs/stream_zh-CN.md b/docs/stream_zh-CN.md index 8d8d1d0..f227704 100644 --- a/docs/stream_zh-CN.md +++ b/docs/stream_zh-CN.md @@ -1,6 +1,6 @@ -# Strutil +# Stream -Stream 实现,该包仅验证简单 go stream 实现,功能有限。 +Stream 流,该包仅验证简单 stream 实现,功能有限。
diff --git a/stream/stream.go b/stream/stream.go index 39197d8..23734a3 100644 --- a/stream/stream.go +++ b/stream/stream.go @@ -2,7 +2,7 @@ // Use of this source code is governed by MIT license // Package stream implements a sequence of elements supporting sequential and operations. -// this package is an experiment to explore if stream in go can work as the way java does. it's function is very limited. +// this package is an experiment to explore if stream in go can work as the way java does. its function is very limited. package stream import (