go get github.com/kkdai/petl
func main() {
ret := PipeProcess(Extract("a s", " smm", "sss"), TransformRemoveSpace, TransformRemoveSpace)
log.Println("ret:", <-ret) //"as"
log.Println("ret2:", <-ret) //"smm"
}
go get github.com/kkdai/petl/petl_cli
Use pipeline for pipe string
//Remove all space in output
cat somefile.txt | petl_cli pipeline="r"
//Make upper case
cat somefile.txt | petl_cli pipeline="u"
//Make lower case
cat somefile.txt | petl_cli pipeline="l"
//Pipeline it
//Will make lower case first then upper case, final remove all space.
cat somefile.txt | petl_cli pipeline="lur"
- Experimenting with Go pipelines
- Go Blog: Go Concurrency Patterns: Pipelines and cancellation
- Comparing Golang, Scala, Elixir, Ruby, and now Python3 for ETL: Part 2
- stackoverflow: Can Functions be passed as parameters in Go?
It is one of my project 52.
etcd is under the Apache 2.0 license. See the LICENSE file for details.