diff --git a/lesson7/lazy_streams/05_new_stream_from_array.go b/lesson7/lazy_streams/05_new_stream_from_array.go new file mode 100644 index 0000000..f3adca9 --- /dev/null +++ b/lesson7/lazy_streams/05_new_stream_from_array.go @@ -0,0 +1,35 @@ +package main + +import ( + "fmt" + "github.com/wesovilabs/koazee/stream" +) + +type User struct { + id uint32 + name string + surname string +} + +func main() { + var users = [3]User{ + User{ + id: 1, + name: "Pepek", + surname: "Vyskoč"}, + User{ + id: 2, + name: "Pepek", + surname: "Vyskoč"}, + User{ + id: 3, + name: "Josef", + surname: "Vyskočil"}, + } + fmt.Println(users) + + fmt.Printf("input: %v\n", users) + + stream := stream.New(users) + fmt.Printf("stream: %v\n", stream.Out().Val()) +}