File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ func main() {
93
93
94
94
### Reduce
95
95
96
- Reduce can accept a reducer and apply the reducer on each element of the input slice while providing an accumulator to save the reduce output
96
+ Reduce can accept a reducer and apply the reducer on each element of the input slice while providing an accumulator to save the reduce output.
97
97
For more [ docs] ( https://godoc.org/github.com/thecasualcoder/godash#Reduce ) .
98
98
99
99
``` go
Original file line number Diff line number Diff line change @@ -9,9 +9,10 @@ import (
9
9
// Currently, input and output for type slice is supported.
10
10
//
11
11
// Validations:
12
- // 1. Mapper function should take in one argument and return one argument
13
- // 2. Mapper function's argument should be of the same type of each element of input slice.
14
- // 3. Mapper function's output should be of the same type of each element of output slice.
12
+ //
13
+ // 1. Mapper function should take in one argument and return one argument
14
+ // 2. Mapper function's argument should be of the same type of each element of input slice.
15
+ // 3. Mapper function's output should be of the same type of each element of output slice.
15
16
//
16
17
// Validation failures are returned as error by the godash.Map to the caller.
17
18
func Map (in , out , mapperFn interface {}) error {
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ import (
18
18
// Reduce does the following validations:
19
19
//
20
20
// 1. Reducer function should accept exactly 2 arguments and return 1 argument
21
- // 2. Reducer function's second argument should be the same type as input slice's element type
22
- // 3. Reducer function's return type should be the same as that of the accumulator
21
+ // 2. Reducer function's second argument should be the same type as input slice's element type
22
+ // 3. Reducer function's return type should be the same as that of the accumulator
23
23
//
24
24
// Validation errors are returned to the caller.
25
25
func Reduce (in , out , reduceFn interface {}) error {
You can’t perform that action at this time.
0 commit comments