lo icon indicating copy to clipboard operation
lo copied to clipboard

💥 A Lodash-style Go library based on Go 1.18+ Generics (map, filter, contains, find...)

Results 291 lo issues
Sort by recently updated
recently updated
newest added

Sometimes if the collection is too big, it will make too many goroutines in one time when using `parallel` methods. That will significantly increase resource usage, especially when the `iteratee`...

method `Reverse` is mutating the original collection, is this expected? ```go collection := []int64{1, 2, 3, 4, 5} fmt.Println(lo.Reverse(collection)) fmt.Println(collection) ``` output: ```bash [5 4 3 2 1] [5 4...

The idea is to remove elements from a slice without making a new slice. ```go func RemoveInPlace[T any](collection []T, predicate func(T) bool) []T { i := 0 for _, x...

This PR adds a function to remove an element from a slice. h/t to https://yourbasic.org/golang/delete-element-slice/

mutable

## Summary ### Scenarios These are the scenarios where the **second error** is needed. If the inner function has more than 1 function call with both error and result that...

This pr adds both lo.MapWithError and lop.MapWithError. This is very useful if your internal function returns an error and you want to short circuit the Map. Currently you can keep...

Lodash describes this operation as returning unique entries https://lodash.com/docs/#intersection Also described in SQL: https://www.postgresql.org/docs/9.4/queries-union.html INTERSECT returns all rows that are both in the result of query1 and in the result...

This won't ruin the ecosystem with security holes, like lodash and underscore is doing for JavaScript