Commit Graph

16 Commits

Author SHA1 Message Date
Samuel Berthe 380e1a0ae2 fix(tests): fix flaky time-based tests (#699)
* fix(tests): fix flaky time-based tests

* test: replace time package with a mock
Using a dedicated dependency would have been awesome, but i try to keep this repo with minimal dependencies
2025-10-05 00:34:07 +02:00
Nathan Baulch 43cef1f439 feat: new iter package (#672)
* lint: pin golangci-lint version

* lint: fix issues triggered by go1.23 upgrade

* feat: new iter package

* lint: fix linter issues

* fix: restore go1.18

* fix: rename package to "it"

* feat: assign multiple sequences of maps

* fix: panic in DropRight if n = 0

* docs: fix incorrect non-iter helper references

* feat: implement Invert helper

* feat: helpers for creating and checking empty sequences

* feat: implement Reverse helper

* feat: implement ReduceRight helper

* feat: implement Shuffle helper

* feat: implement Sample* helpers

* refactor: rename helpers with Seq convention

* feat: implement SeqToChannel2 helper

* feat: implement HasPrefix/HasSuffix helpers

* chore: port recent changes

* perf: only iterate collection once in Every

* refactor: reduce dupe code by reusing helpers internally

* perf: reuse internal Mode slice

* feat: implement Length helper

* chore: duplicate unit tests for *I helpers

* fix: omit duplicates in second Intersect list

* feat: intersect more than 2 sequences

* feat: implement Drain helper

* feat: implement Seq/Seq2 conversion helpers

* refactor: rename *Right* to *Last*

* chore: minor cleanup

* refactor: consistent predicate/transform parameter names

* perf: abort Slice/Subset once upper bound reached

* refactor: rename IsSortedByKey to IsSortedBy

* refactor: reuse more helpers internally

* feat: implement Cut* helpers

* feat: implement Trim* helpers

* perf: reduce allocations

* docs: describe iteration and allocation expectations

* Update .github/workflows/lint.yml

---------

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2025-10-02 19:23:16 +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 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 76b76a7adb lint: Apply testifylint linter recommendations (#669) 2025-09-20 00:50:00 +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 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
Anandraj Elumalai 27d881052b fix: resolved code smells (#258)
Made the project to smell good

Co-authored-by: aelumalai <aelumalai@paypal.com>
2022-10-31 15:48:04 +01:00
VictorAssunc 640e00c286 chore: test coverage improvement (#240)
* chore: improves channel functions test coverage

* chore: improves errors functions test coverage

* chore: improves map functions test coverage

* chore: improves parallel slice functions test coverage

* chore: improves slice functions test coverage

* fix: uses atomic counter on parallel/slice_test

* Update channel_test.go

Co-authored-by: Samuel Berthe <dev@samuel-berthe.fr>
2022-10-22 19:05:07 +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 f44773e344 feat: adding CountValuesBy 2022-10-10 21:26:19 +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
Samuel Berthe 31f3bc3a85 test: parallel tests everywhere (#228) 2022-10-02 21:38:26 +02:00
Samuel Berthe 0fb185c15c feat: adding lo.ChannelDispatcher and 6 basic dispatching strategies 2022-09-05 13:01:10 +02:00