Skip to content

Instantly share code, notes, and snippets.

@ivancorrales
Created December 15, 2018 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivancorrales/c297cf2b077fb2d12ab0b2e999b9b3c9 to your computer and use it in GitHub Desktop.
Save ivancorrales/c297cf2b077fb2d12ab0b2e999b9b3c9 to your computer and use it in GitHub Desktop.
stream.Map
package main
import (
"fmt"
"github.com/wesovilabs/koazee"
"strings"
)
var animals = []string{"lynx", "dog", "cat", "monkey", "dog", "fox", "tiger", "lion"}
func main() {
fmt.Printf("input: %v\n", animals)
stream := koazee.StreamOf(animals)
fmt.Print("stream.Map(strings.Title): ")
fmt.Println(stream.Map(strings.Title).Do().Out().Val())
}
/**
go run main.go
input: [lynx dog cat monkey dog fox tiger lion]
stream.Map(strings.Title): [Lynx Dog Cat Monkey Dog Fox Tiger Lion]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment