Skip to content

Commit

Permalink
feat: update readme for new package name
Browse files Browse the repository at this point in the history
  • Loading branch information
SkippyZA committed Sep 13, 2024
1 parent d24f662 commit f3556e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![linters](https://github.com/SkippyZA/go-slices/actions/workflows/lint.yml/badge.svg)](https://github.com/SkippyZA/go-slices/actions/workflows/lint.yml)
[![test](https://github.com/SkippyZA/go-slices/actions/workflows/test.yml/badge.svg)](https://github.com/SkippyZA/go-slices/actions/workflows/test.yml)
[![test](https://github.com/SkippyZA/go-slices/actions/workflows/test.yml/badge.svg)](https://github.com/SkippyZA/go-slices/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/SkippyZA/go-slices/branch/master/graph/badge.svg?token=OLBD9XQKZX)](https://codecov.io/gh/SkippyZA/go-slices)
![release](https://img.shields.io/github/v/release/skippyza/go-slices?include_prereleases)

Expand All @@ -17,21 +17,21 @@ go get github.com/skippyza/go-slices

Filter even numbers
```golang
slices.Filter([]int{1, 2, 3, 4, 5}, func(i int) bool { return i%2 == 0 })
goslices.Filter([]int{1, 2, 3, 4, 5}, func(i int) bool { return i%2 == 0 })
// [2 4]
```

Double all the numbers
```golang
double := func(i int) int { return i*2 }
slices.Map([]int{8, 14, 23}, double)
goslices.Map([]int{8, 14, 23}, double)
// [16 28 46]
```

Sum all the numbers in a slice
```golang
sum := func(a, b int) int { return a+b }
slices.Reduce([]int{5, 1, 2, 2}, sum, 0)
goslices.Reduce([]int{5, 1, 2, 2}, sum, 0)
// 10
```

Expand Down

0 comments on commit f3556e3

Please sign in to comment.