fix: example

This commit is contained in:
Ruidy 2022-01-02 19:14:37 -04:00
parent 73ed4021a6
commit b82129f655

View file

@ -3,11 +3,11 @@ package examples
import ( import (
"fmt" "fmt"
u "github.com/rjNemo/underscore" "github.com/rjNemo/underscore/chain"
) )
func chaining() { func chaining() {
sum := u.NewChain([]int{1, 2, 3, 4, 5, 6, 7, 8, 9}). sum := chain.Of([]int{1, 2, 3, 4, 5, 6, 7, 8, 9}).
// filter even numbers from the slice // filter even numbers from the slice
Filter(func(n int) bool { return n%2 == 0 }). Filter(func(n int) bool { return n%2 == 0 }).
// square every number in the slice // square every number in the slice