文件名称:go-stream:Java Stream API的golang实现
文件大小:7KB
文件格式:ZIP
更新时间:2024-05-15 17:22:02
Go
流 go-stream在golang中提供Java Stream API类似于流操作 用法 package main import ( "github.com/aagu/go-stream" ) func main () { ints := [] int { 1 , 2 , 3 , 4 , 5 , 6 , 7 } stream . New ( ints ). Filter ( func ( i interface {}) bool { return i .( int ) % 2 == 0 }). FlatMap ( func ( i interface {}) [] interface {} { return [] interface {}{ i , i .( int ) + 2 } }). Distinct (). ForEach ( func ( i i
【文件预览】:
go-stream-master
----stateful_ops.go(3KB)
----terminal_ops.go(1KB)
----stateless_ops.go(808B)
----stream.go(6KB)
----stream_test.go(2KB)
----parallel_stream.go(1KB)
----README.md(1KB)
----sink_wrapper.go(3KB)
----go.mod(42B)