Commit Graph

599 Commits

Author SHA1 Message Date
dependabot[bot]
975e837466 chore(deps): bump golangci/golangci-lint-action from 7 to 8 (#628)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 7 to 8.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v7...v8)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-05 15:15:36 +02:00
ghosx
3a534ad9b4 Fixed the error in the usage example of lo.Latest in readme.md (#627)
* Update README.md

Fixed the error in the usage example of lo.Latest in readme.md

use []time.Time{…} (value of type []time.Time) as time.Time value in argument to lo.Latest

* Update README.md

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-05-03 22:22:59 +02:00
Samuel Berthe
e62450f888 Revert "chore(deps): bump golang.org/x/text from 0.22.0 to 0.24.0 (#625)" (#626)
This reverts commit a743f2a685.
2025-04-28 15:28:54 +02:00
dependabot[bot]
a743f2a685 chore(deps): bump golang.org/x/text from 0.22.0 to 0.24.0 (#625)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.22.0 to 0.24.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.22.0...v0.24.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-version: 0.24.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-28 15:14:44 +02:00
Samuel Berthe
7f3c0b84fd Update README.md 2025-04-26 19:43:12 +02:00
Samuel Berthe
4fdf4d1fe2 Update README.md 2025-04-26 19:35:20 +02:00
Oganes Mirzoyan
4a43ff68b4 Add ElementsMatch, ElementsMatchBy (#589)
* Add ElementsMatch, ElementsMatchBy

* Update intersect.go

* Update README.md

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-04-26 19:06:51 +02:00
Samuel Berthe
0bc568abfc Update README.md 2025-04-26 19:03:52 +02:00
Samuel Berthe
c7a67cad51 feat(mutable): adding Map, MapI, Filter, FilterI (#577)
* feat(mutable): adding Map, MapI, Filter, FilterI

* Update README.md

* doc: add doc and examples for lom.Filter

* oops
2025-04-26 18:54:36 +02:00
Samuel Berthe
e5dba6f459 feat: adding FilterMapToSlice (#623) 2025-04-26 18:13:17 +02:00
Oswaldo Montaño
e343af088f docs: add play link for ChunkEntries example in README (#600)
* docs: add play link for ChunkEntries example in README

* Update map.go

---------

Co-authored-by: Oswaldo Montaño <oswaldo.montano.ext@diagroup.com>
Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-04-26 17:46:02 +02:00
Artem Mikheev
38f67506fe optimization: preallocate result in FilterMap (#622)
Co-authored-by: Artem Mikheev <renbou@pinely.com>
2025-04-26 17:34:10 +02:00
Samuel Berthe
d91b19f1eb chore: lint 💄 2025-04-26 17:33:43 +02:00
Samuel Berthe
964a3c7ac3 chore(ci): test more go version 2025-04-24 00:52:33 +02:00
Samuel Berthe
0f7f47e338 fix: fix backward compatibility to go 1.18 2025-04-24 00:46:03 +02:00
Ahmed Ashraf
2bc3746616 fix typo in readme (#620) 2025-04-13 00:19:30 +02:00
dependabot[bot]
3f3aab7a26 chore(deps): bump golang.org/x/text from 0.22.0 to 0.24.0 (#618)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.22.0 to 0.24.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.22.0...v0.24.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-version: 0.24.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-09 02:04:07 +02:00
dependabot[bot]
3ce2b6f9c9 chore(deps): bump golangci/golangci-lint-action from 6 to 7 (#616)
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/v6...v7)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-02 23:27:09 +02:00
Edvard
87553560d4 feat: Add NthOr and NthOrEmpty functions (#611)
* feat: Add NthOr and NthOrEmpty functions

This commit introduces two new functions, `NthOr` and `NthOrEmpty`, to the `find` package. These functions provide a safer way to access elements at a specific index in a slice, handling out-of-bounds scenarios gracefully.

- `NthOr`: Returns the element at the specified index or a provided fallback value if the index is out of bounds.
- `NthOrEmpty`: Returns the element at the specified index or the zero value for the slice's element type if the index is out of bounds.

* update readme
2025-03-17 00:13:20 +01:00
peterhoward42
17d82f463d fix: Issue 605 (README for Ternary() (#606)
* fix: Issue 605

* Add the Ternary comment from prev commit to function docstring
2025-03-04 21:25:46 +01:00
Jialei
b828ea137f doc: update CoalesceXXX demo and result (#594) 2025-02-22 20:35:39 +01:00
shunsuke takii
fe0618f731 docs: modify mutable example docs (#595)
docs: modify mutable example docs
2025-02-22 20:33:42 +01:00
overbeck
0fa0632c0f Perf(slice): Optimize iteration function parameters and add test cases (#587)
- Modify the iteration function parameters in the UniqueBy, GroupByMap, and Keyify functions to use index access for collection elements.
- Optimize parameter naming in the GroupByMap function to improve code readability.
- Add test cases for the GroupByMap function to cover different types of inputs.

Co-authored-by: ShuQingZai <overbeck.jack@outlook.com>
2025-02-17 00:10:10 +01:00
dependabot[bot]
12a8b78b75 chore(deps): bump golang.org/x/text from 0.21.0 to 0.22.0 (#590)
Bumps [golang.org/x/text](https://github.com/golang/text) from 0.21.0 to 0.22.0.
- [Release notes](https://github.com/golang/text/releases)
- [Commits](https://github.com/golang/text/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: golang.org/x/text
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-10 12:10:24 +01:00
Samuel Berthe
70b763eac5 Merge branch 'maryum375-master' 2025-01-28 20:25:26 +01:00
Samuel Berthe
ce12685a40 fix(groupbymap): remove second iteratee and add test+example+doc 2025-01-28 20:25:04 +01:00
Ran Mariuma
19cb99199d Implemented GroupByMapValues 2025-01-28 20:12:52 +01:00
Samuel Berthe
96d5482643 fix(product): fix empty slice behavior (#583) (#584) 2025-01-28 12:35:04 +01:00
Samuel Berthe
2bdcacae5e doc: add example for Product and ProductBy 2025-01-27 01:05:21 +01:00
JohnDevitt
1c1dfd9d29 feat: add Product and ProductBy functions (#566)
Co-authored-by: John.Devitt@cdp.net <JohnDevitt@Mac.cust.communityfibre.co.uk>
2025-01-27 01:02:11 +01:00
Samuel Berthe
124d3004de feat: adding FilterSliceToMap (#581) 2025-01-26 23:32:59 +01:00
Samuel Berthe
19d8355ae8 Merge branch 'Lee-Minjea-feat/throttle' 2025-01-26 22:49:20 +01:00
Samuel Berthe
5cd32660f6 feat: adding ExampleNewThrottleBy and ExampleNewThrottleByWithCount 2025-01-26 22:47:39 +01:00
Lee,Minjea
fdd886509a fix: test case fixed 2025-01-26 19:59:39 +01:00
minjea.lee
27638ea5b7 feat: adding NewThrottle (#396) 2025-01-26 19:59:39 +01:00
Samuel Berthe
d5876775c8 feat: faster ChunkEntries 2025-01-26 19:51:43 +01:00
Samuel Berthe
28a4d94ffe Merge branch 'oswaldom-code-feat-adding-chunk-map' 2025-01-26 19:39:10 +01:00
Samuel Berthe
4a03b54ea4 rename ChunkMap to ChunkEntries 2025-01-26 19:38:33 +01:00
Oswaldo Montaño
359dc0f572 feat: Implement ChunkMap (#533) 2025-01-26 19:15:10 +01:00
Samuel Berthe
6b110b3c4f test(withoutempty): missing test 2025-01-26 18:10:37 +01:00
Xin Hao
f1c337945a feat: Add IsNotNil (#523)
* Add IsNotNil

* Apply suggestions from code review

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-01-26 16:19:29 +01:00
Bram Van de Walle
86ce870075 feat: add SampleBy and SamplesBy (#516)
* Add SampleBy and SamplesBy

Co-authored-by: Bram Van de Walle <bram.vandewalle@otainsight.com>
Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-01-26 15:57:04 +01:00
Samuel Berthe
699707a0db feat(mutable): shuffle 2025-01-26 00:02:51 +01:00
Samuel Berthe
64e89e4766 Merge branch 'nicklaus-dev-nick-add-without-by' 2025-01-25 23:43:55 +01:00
Samuel Berthe
4201d6e342 doc 2025-01-25 23:43:47 +01:00
Samuel Berthe
33f7b14d1d Merge branch 'master' into nick-add-without-by 2025-01-25 23:40:21 +01:00
Samuel Berthe
7166d516a1 Merge branch 'nicklaus-dev-master' 2025-01-25 23:27:18 +01:00
Samuel Berthe
27d2554396 fix: renaming SliceToSet to Keyify 2025-01-25 23:26:53 +01:00
nicklausliu
dd2eaa966a feat: add README 2025-01-25 23:23:30 +01:00
nicklausliu
4b7879b22d feat: add more duplicate test 2025-01-25 23:23:30 +01:00