Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Unit Tests
on: [ push, pull_request ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Install gotip
run: |
git clone --depth=1 https://go.googlesource.com/go $HOME/gotip
cd $HOME/gotip/src
./make.bash
echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV
echo "$HOME/gotip/bin:$PATH" >> $GITHUB_PATH
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Test
run: go test -v ./...
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

![License](https://img.shields.io/github/license/rjNemo/underscore?style=for-the-badge)
![Go version](https://img.shields.io/github/go-mod/go-version/rjNemo/underscore?style=for-the-badge)

![test coverage](https://img.shields.io/badge/Test%20Coverage-100%25-brightgreen.svg?longCache=true&style=for-the-badge)

![underscore](https://socialify.git.ci/rjNemo/underscore/image?description=1&font=Raleway&language=1&logo=https%3A%2F%2Fgithub.com%2FrjNemo%2Funderscore%2Fblob%2Fmain%2Fdocs%2Fstatic%2Flogo.png%3Fraw%3Dtrue&name=1&pattern=Floating%20Cogs&theme=Light)
Expand Down
2 changes: 1 addition & 1 deletion examples/chaining.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
u "github.com/rjNemo/underscore"
)

func main() {
func chaining() {
sum := u.NewChain([]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 }).
Expand Down
2 changes: 1 addition & 1 deletion examples/filterMapReduce.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
u "github.com/rjNemo/underscore"
)

func main() {
func filterMapReduce() {
numbers := []int{1, 2, 3, 4, 5, 6, 7, 8, 9}
// filter even numbers from the slice
evens := u.Filter(numbers, func(n int) bool { return n%2 == 0 })
Expand Down