github.com/jwowillo/pipe@v1.2.0/example_test.go (about) 1 package pipe_test 2 3 import ( 4 "fmt" 5 6 "github.com/jwowillo/pipe" 7 ) 8 9 func Example() { 10 p := pipe.New( 11 pipe.StageFunc(func(x pipe.Item) pipe.Item { 12 return x.(string) + "a" 13 }), 14 pipe.StageFunc(func(x pipe.Item) pipe.Item { 15 return x.(string) + "b" 16 }), 17 pipe.StageFunc(func(x pipe.Item) pipe.Item { 18 return x.(string) + "c" 19 }), 20 ) 21 p.Receive("") 22 fmt.Println(p.Deliver()) 23 // Output: 24 // abc 25 }