lo
lo copied to clipboard
Use variadic parameters in Min and Max
Greetings and thanks to this amazing project! I used Min and Max quite frequently and I found it annoying that I have to put the values into an array even when I got two elements. From my previous exp with c++, variadic parameters is used in max signature so developer can enter any number of parameters without creating an array/slice on themselves (see ref).
The usage for Max could be:
max := lo.Max(1, 2, 3)
If developer wants to find the max element from an array, they can do:
array := []int{1, 2, 3}
max := lo.Max(array...)
This is a great suggestion!
It might be worth replacing the Zip2 through Zip9 functions with a single variadic version as well.