mirror of
https://github.com/rjNemo/underscore
synced 2026-06-06 02:26:42 +00:00
fix: example
This commit is contained in:
parent
73ed4021a6
commit
b82129f655
1 changed files with 2 additions and 2 deletions
|
|
@ -3,11 +3,11 @@ package examples
|
|||
import (
|
||||
"fmt"
|
||||
|
||||
u "github.com/rjNemo/underscore"
|
||||
"github.com/rjNemo/underscore/chain"
|
||||
)
|
||||
|
||||
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(func(n int) bool { return n%2 == 0 }).
|
||||
// square every number in the slice
|
||||
|
|
|
|||
Loading…
Reference in a new issue