lo icon indicating copy to clipboard operation
lo copied to clipboard

Add push, pop, shift, & unshift functions.

Open FGasper opened this issue 1 year ago • 2 comments

This allows code like the following:

foo := []int{1, 2, 3}
lo.Push(&foo, 4)

… which is a bit more concise than Go’s familiar foo = append(foo, 4) idiom.

If the maintainers agree that these are good additions, I’ll add tests before merging.

Thanks!

FGasper avatar Feb 06 '25 13:02 FGasper

Codecov Report

Attention: Patch coverage is 0% with 44 lines in your changes missing coverage. Please review.

Project coverage is 92.98%. Comparing base (70b763e) to head (27038f3). Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
slice.go 0.00% 44 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #588      +/-   ##
==========================================
- Coverage   94.27%   92.98%   -1.29%     
==========================================
  Files          18       18              
  Lines        3178     3222      +44     
==========================================
  Hits         2996     2996              
- Misses        170      214      +44     
  Partials       12       12              
Flag Coverage Δ
unittests 92.98% <0.00%> (-1.29%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov[bot] avatar Feb 06 '25 13:02 codecov[bot]

Please move this work to mutable/ directory.

samber avatar Feb 16 '25 22:02 samber