Commit Graph

21 Commits

Author SHA1 Message Date
Samuel Berthe cd78292882 💄 2026-03-02 16:06:51 +01:00
Samuel Berthe 153f867680 feat: adding MeanByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe e9037c6e8c feat: adding ProductByErr helper 2026-03-02 16:06:51 +01:00
Samuel Berthe 12e2b4ceb4 feat: adding SumByErr helper 2026-03-02 16:06:51 +01:00
d-enk b0b5cc3adf perf: preallocate result slice in RangeWithSteps (#820)
- RangeWithSteps now preallocates result slice using math.Ceil for better performance
- Fix edge cases for floating point values with small steps
- Add test cases for float and custom type validation
- Rename TestRangeClose → TestRangeWithSteps for consistency
- Simplify ChunkEntries chunk count calculation using ((count-1)/size)+1 formula
2026-02-25 20:48:26 +01:00
d-enk 2859d7382f perf: use Ternary() instead If().Else() in Range/RangeFrom (#770)
No allocs in it.Range, it.RangeFrom

Add more tests
2026-01-13 11:34:46 +01:00
Samuel Berthe bc738690ca style: fix linter 2025-10-12 18:24:32 +02:00
Anurag Ojha 02d371c58e fix(it.Mode): align behavior with lo.Mode and ensure consistent slice… (#711)
* fix(it.Mode): align behavior with lo.Mode and ensure consistent slice capacity

* replicating test section in main package
2025-10-12 15:58:37 +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
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 96d5482643 fix(product): fix empty slice behavior (#583) (#584) 2025-01-28 12:35:04 +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
Usman Ahmed 97074eeae7 Adding Mean and MeanBy (#414)
* feat: create Mean for ints and floats

* feat: create MeanBy for ints and floats

* chore: add example tests for mean Mean and MeanBy
2024-06-27 13:45:28 +02:00
Samuel Berthe ce01c4c64b doc: improve doc for lo.Sum 2022-10-10 22:25:14 +02:00
JC Dansereau 6f0207afd8 add slice sum (#210)
Co-authored-by: JC Dansereau <jcdansereau@hortau.com>
2022-10-10 22:18:57 +02:00
Samuel Berthe 31f3bc3a85 test: parallel tests everywhere (#228) 2022-10-02 21:38:26 +02:00
lu4p 305f565368 remove unnecessary explicit typeparams (#134) 2022-05-11 13:10:36 +02:00
Pål Fossmo 9b345886aa Moved SumBy function to math.go.
Changed from data types to constraints in SumBy function signature.
2022-04-30 21:06:31 +02:00
Samuel Berthe cf11153875 feat: adding Clamp 2022-04-12 21:58:28 +02:00