-
Notifications
You must be signed in to change notification settings - Fork 31
Operation sort
Iván Corrales Solera edited this page Dec 2, 2018
·
1 revision
It sorts the elements in the stream b the given function
package main
import (
"fmt"
"github.com/wesovilabs/koazee"
)
var stream = koazee.StreamOf([]int{2, 1, 4, 5, 3})
func main() {
out := stream.Sort(func(x, y int) int {
if x <= y {
return -1
}
return 1
}).Do()
fmt.Println(out.Out().Val().([]int))
}
@2018 Koazee by Iván Corrales Solera [email protected]