28 Commits

Author SHA1 Message Date
Samuel Berthe 86e5d8b15d refactor: remove helpers deprecated for more than 3y (#810) 2026-02-22 05:14:28 +01:00
d-enk d269b33e8c perf: replace Min/Max(Range) with Min/MaxIndexBy in DispatchingStrategy (#779)
- Replace Range+MinBy with MinIndexBy in DispatchingStrategyLeast for better performance
- Replace Range+MaxBy with MaxIndexBy in DispatchingStrategyMost for better performance
- Use range loop in DispatchingStrategyWeightedRandom for better readability
- Simplify Buffer function by using local variable in for loop and returning size directly

These changes reduce allocations and improve performance by using more efficient
index-finding functions instead of creating intermediate slices with Range().
2026-02-08 02:38:15 +01:00
d-enk 7d777446ab refactor: simplify for loop (#772)
* refactor: use available in go1.23 range over int in `it.Times`

* refactor: use range over chan in `ChannelDispatcher`
2026-01-12 20:40:20 +01:00
Samuel Berthe 18c5a43f79 Style/rename internal rand (#701)
* style: rename internal/rand package to internal/xrand

* doc: internal package readme

* oops
2025-10-05 00:42:41 +02:00
Samuel Berthe dedd62f639 style: linter 2025-10-04 21:49:33 +02:00
Samuel Berthe 81d6aae23d feat(generator): deprecate lo.Generator in favor of go "iter" package (#700) 2025-10-04 21:48:18 +02:00
Nathan Baulch f5aac81cc0 lint: enable gofumpt extra rules (#690)
Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-09-26 13:32:59 +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 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 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
Samuel Berthe bb32fc732f feat: adding lo.BufferWithContext (#580)
* feat: adding lo.BufferWithContext

* Add BufferWithContext to README table of contents
2025-01-25 22:46:36 +01:00
Samuel Berthe 3b29b7d918 feat: upgrade to math/rand/v2 (#483)
* feat: upgrade to math/rand/v2

* lint: silent warning
2024-06-30 03:54:55 +02:00
Samuel Berthe 61209816d1 feat: speed up loops by reducing allocations (#475) 2024-06-28 01:35:57 +02:00
Samuel Berthe 0efce40cf0 lint 2024-06-27 21:05:31 +02:00
Samuel Berthe 43cb1bdf1c merged from #313 2023-03-20 17:53:44 +01:00
ender d8986f4238 doc: generics in the example (#318)
Co-authored-by: miaoyin <miaoyin@woda.com>
2023-03-20 15:08:19 +01:00
Olivier Mengué 34ad3da0f1 doc: add doc links on Deprecated notices
Add doc links in deprecation notices mentionned in Go doc comments.

About doc links: https://go.dev/doc/comment#doclinks
2023-02-22 22:00:57 +01:00
Olivier Mengué 439ee11a5d doc: fix formatting of Deprecated notices
Add an empty comment line before "Deprecated:" notices in Go documentation to
follow the convention defined in
https://github.com/golang/go/wiki/Deprecated

This will allow tooling to inform developers about use of those
deprecated APIs.
2023-02-22 21:53:51 +01:00
Samuel Berthe a133373ee3 rename lo.Batch to lo.Buffer and lo.BatchWithTImeout to lo.BufferWithTimeout 2022-11-15 18:24:44 +01:00
Samuel Berthe 34ef81e140 feat: rename ChannelMerge to FanIn and add FanOut (#262) 2022-11-12 00:30:53 +01:00
Samuel Berthe a14c1b20be doc: add ChannelMerge 2022-10-14 10:36:08 +02:00
H d899a1ce0b feat: add ChannelMerge (#241)
Co-authored-by: hhu <hhu@tencent.com>
2022-10-14 10:31:28 +02:00
Samuel Berthe 7887963db8 feat: name each callback/iteratee/predicate arguments in order to improve autocompletion
closes #242
2022-10-13 22:25:33 +02:00
Samuel Berthe 5d99d5a0ca adding ChannelToSlice 2022-10-07 00:53:43 +02:00
Samuel Berthe 0bd7b562a9 New helper collection: channel (#95)
* feat(channels): add ToChannel + Generator + Batch + BatchWithTimeout (WIP)

* feat: return duration of Batch**** helpers

* doc: improve BatchWithTimeout doc

* fix(BatchWithTimeout): replace time.After by time.NewTimer in order to prevent memory leak

* doc: improve BatchWithTimeout doc
2022-10-07 00:36:31 +02:00
Jiepeng Cao 282789fe09 typo (#222) 2022-10-02 21:23:19 +02:00
Samuel Berthe 0fb185c15c feat: adding lo.ChannelDispatcher and 6 basic dispatching strategies 2022-09-05 13:01:10 +02:00