godash
godash copied to clipboard
Lodash for Golang
Given go lang now has full generics support. This package can benefit greatly from it by removing all reflection code.
## Checklist for PR [x] Link to corresponding Issue. [8](https://github.com/thecasualcoder/godash/issues/8) [x] Tests covering all the code branches. [x] Validations for all the argument's type. This includes the functions passed as...
- resue the build steps locally and in travis-ci - avoid passing same argument all the time for running test - avoid running multiple commands - golint - golancli-lint -...
API: ```go array1 := []int{1,2,3} array2 := []int{4,5,6} array3 := []int{7,8,9} var ouput []int godash.Flatten(&output, array1, array2, array3) // output should be []int{1,2,3,4,5,6,7,8,9} ```
Uniq will return the unique set of elements in the given array API ```go input := []int{1,1,2,2,3,4,3} var output []int godash.Uniq(input, &output) fmt.Println(output) // Output: [1 2 3 4] ```
API ```go input := make(chan int) var output int go func() { for i := 0; i
Currently, we assume that the predicate/mapper/reducer functions will only return one type of value. There are cases where the functions may generate errors inside. In order to handle this, let...
The API and behaviour is same as `godash.Map`. Same validations apply. Just that the `mapperFn` has to be executed on all elements in Go routines and the output is collected...
API ```go john := Person{name: "John", age: 25} doe := Person{name: "Doe", age: 30} wick := Person{name: "Wick", age: 25} input := []Person{ john, doe, wick, } var output map[int][]Person...