640 Commits

Author SHA1 Message Date
Samuel Berthe
850d795cce chore(release): i'm an idiot - keep examples because godoc uses them 2025-09-25 15:54:01 +02:00
Nathan Baulch
1b92b5c7db lint: enable 7 more linters (#686)
* lint: enable and fix perfsprint issues

* lint: enable and fix nolintlint issues

* lint: enable and fix godot issues

* lint: enable and fix thelper issues

* lint: enable and fix tparallel issues

* lint: enable and fix paralleltest issues

* lint: enable and fix predeclared issues
2025-09-25 13:18:25 +02:00
Nathan Baulch
2911f93956 fix: panic when passing -1 to Drop (#688) 2025-09-25 13:11:52 +02:00
Nathan Baulch
508d49270f fix: avoid recover() if possible (#685) 2025-09-25 04:34:42 +02:00
Samuel Berthe
268215359e fix(string): fix division by zero (#684) 2025-09-25 04:21:56 +02:00
Samuel Berthe
ec86b574ed feat: adding TrimXXX methods (#683) 2025-09-25 04:15:30 +02:00
Nathan Baulch
52d31f788f lint: fix CI warnings and avoid named return parameters (#682) 2025-09-25 03:44:33 +02:00
Alex Klepov
21a523ddc0 Added Cut, CutPrefix, CutSuffix (#666)
* Added Cut, CutPrefix, CutSuffix

* fix readme

* Clarify Cut, CutPrefix, and CutSuffix documentation

Updated descriptions and examples for Cut, CutPrefix, and CutSuffix functions to clarify usage with slices.

* Refactor Cut, CutPrefix, and CutSuffix functions

* Update slice_test.go

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-09-25 01:52:48 +02:00
Samuel Berthe
928ed09f00 doc(readme): added missing link in menu section 2025-09-24 23:40:00 +02:00
Samuel Berthe
8fbeee63be doc: add examples for find.go (#681) 2025-09-24 23:19:09 +02:00
Samuel Berthe
9a5336a8f9 feat: adding hassuffix + hasprefix (#680) 2025-09-24 23:18:51 +02:00
Nathan Baulch
41cbf0fd2b feat: preserve type alias in DropByIndex and WithoutBy (#675)
* lint: pin golangci-lint version

* feat: preserve type alias in WithoutBy

* feat: preserve type alias in DropByIndex

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-09-24 22:57:40 +02:00
Nathan Baulch
5196e100c3 fix: minor example issues (#676)
* lint: pin golangci-lint version

* fix: minor example issues

* Update lint.yml

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-09-24 22:52:23 +02:00
Nathan Baulch
3210326df6 chore: minor whitespace fixes (#677)
* lint: pin golangci-lint version

* chore: minor whitespace fixes

* lint: enable whitespace linter

* Apply suggestions from code review

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-09-24 22:48:54 +02:00
Nathan Baulch
7170719ec0 lint: unit test improvements (#674)
* lint: pin golangci-lint version

* lint: use is.Empty where possible

* lint: use is.ElementsMatch for unsorted slices

* lint: remove redundant is.Len assertions

* lint: use is.Zero to assert zero structs

* fix: misc assertion issues

* lint: more consistent test case pattern

* fix: reversed expect/actual assert values

* lint: use is.ErrorIs and is.EqualError for errors

* Update golangci-lint version in workflow

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-09-24 21:02:52 +02:00
Nathan Baulch
b5e290abe0 fix: more consistent panic strings (#678)
* lint: pin golangci-lint version

* fix: more consistent panic strings

* Update golangci-lint version in workflow

Updated golangci-lint action version to v2.4.

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-09-24 21:02:02 +02:00
Nathan Baulch
3e11f11781 docs: grammar improvements (#673)
* lint: pin golangci-lint version

* docs: grammar fixes

* docs: remove "truthy" terminology

* docs: remove "array" terminology

* docs: grammar fixes

* Update .github/workflows/lint.yml

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-09-24 20:59:41 +02:00
Samuel Berthe
7e6d6e0673 chore: remove docker - a lightweight project is beautiful 2025-09-24 16:22:38 +02:00
Samuel Berthe
3bc887c57c doc: adding go playground examples 2025-09-23 14:54:30 +02:00
Samuel Berthe
9c8308ffda Style add golangci config (#670)
* style(lint): gofumpt

* style(lint): errcheck

* style(lint): revive

* style(lint): gocritic

* style(lint): forcetypeassert

* style(lint): add .golangci.yml

* oops
2025-09-20 01:37:51 +02:00
Nathan Baulch
76b76a7adb lint: Apply testifylint linter recommendations (#669) 2025-09-20 00:50:00 +02:00
Samuel Berthe
ba60e479fc Update dependabot.yml 2025-09-02 16:10:31 +02:00
dependabot[bot]
f2c5cd089f chore(deps): bump github.com/stretchr/testify from 1.11.0 to 1.11.1 (#663)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.11.0 to 1.11.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.11.0...v1.11.1)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-version: 1.11.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-01 15:02:59 +02:00
dependabot[bot]
af4300db26 chore(deps): bump github.com/stretchr/testify from 1.10.0 to 1.11.0 (#662)
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.10.0 to 1.11.0.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.10.0...v1.11.0)

---
updated-dependencies:
- dependency-name: github.com/stretchr/testify
  dependency-version: 1.11.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-08-25 18:00:16 +02:00
Samuel Berthe
579fdad713 feat: adding FilterValues and fix FilterKeys signature (#661)
* feat: adding FilterValues and fix FilterKeys signature

* oops
2025-08-24 12:43:12 +02:00
Rasha
7ccf4aadc4 add FilterKeys (#631) 2025-08-24 12:31:42 +02:00
dependabot[bot]
ef7cc1ab16 chore(deps): bump actions/checkout from 4 to 5 (#659)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  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-08-18 15:48:58 +02:00
mengxun
b1a108d0d3 docs: Fix the Markdown syntax that is not displaying correctly (#658) 2025-08-12 16:51:21 +02:00
ghosx
bededfed30 feature: add Mode function with tests and documentation (#644)
* 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

* feature: add Mode function with tests and documentation

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-07-07 02:05:39 +02:00
Samuel Berthe
c66dc5432a fix: fix randomly failing test 2025-07-07 02:03:06 +02:00
Samuel Berthe
0906f969ae fix(retry): fix potential race condition in debounce callback (#650)
* fix(retry): fix potential race condition in debounce callback

* fix previous commit: make it compatible with old go version
2025-07-06 18:17:27 +02:00
Samuel Berthe
68d57fe402 fix(zipx): fix the max length calculation (#649) 2025-07-06 17:28:27 +02:00
Samuel Berthe
f8024de2ce fix(chunk): Copy chunk in a new slice (#648)
Prevents memory leak and free memory from initial collection.
2025-07-06 15:33:18 +02:00
Mark Hildreth
82f753a511 Fix Product and ProductBy documentation (#647)
These functions stated that if empty they return 0, but in actuality the code returns 1
2025-07-02 17:28:50 +02:00
Samuel Berthe
49f24de919 style: merge assertion.go and errors.go 2025-06-01 16:19:29 +02:00
ynn
e9281d8a66 feat(assertions): add Assert and Assertf (#638)
Co-authored-by: ynn <contact@your-diary.io>
2025-06-01 16:12:44 +02:00
Ali Sunjaya
2b57de74f4 docs: fix wrong variable name for mutable map example (#637) 2025-05-27 11:11:51 +02:00
Emil Shakirov
f2cfb22748 docs: Fix description for LastOrEmpty and LastOr (#636) 2025-05-22 13:13:51 +02:00
Samuel Berthe
52ad90c405 doc: Improve comment for lo.Ellipsis 2025-05-22 13:13:05 +02:00
mengxun
f1dce8f5e7 docs: Add a more precise description to the Ellipsis function to prevent misunderstanding. (#635)
Signed-off-by: mengxun <mengxun1122@163.com>
2025-05-22 13:12:10 +02:00
d-enk
a9a589c4d5 fix(ci): correct cleanup deps - remove all *_test.go files using find (#630) 2025-05-05 21:09:38 +02:00
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