Skip to content

Commit

Permalink
Example #12: Add and Drop methods
Browse files Browse the repository at this point in the history
  • Loading branch information
tisnik committed Jul 13, 2020
1 parent b699f33 commit 58e04a0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions lesson7/lazy_streams/12_add_drop.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package main

import (
"fmt"
"github.com/wesovilabs/koazee"
)

func main() {
values := []int{1, 2, 3, 4, 5}
fmt.Printf("input: %v\n", values)

stream1 := koazee.StreamOf(values)
stream2 := stream1.Add(6)
stream3 := stream1.Drop(3)
stream4 := stream1.Drop(10)

fmt.Printf("stream1: %v\n", stream1.Out().Val())
fmt.Printf("stream2: %v\n", stream2.Out().Val())
fmt.Printf("stream3: %v\n", stream3.Out().Val())
fmt.Printf("stream4: %v\n", stream4.Out().Val())
}

0 comments on commit 58e04a0

Please sign in to comment.