roosteracham
Results
2
comments of
roosteracham
package fp // Calls a defined by function on each element of an array, and returns an array with all element distinct. func Unique[T any, K comparable](by func(T) K) func([]T)...
package fp import ( "testing" "github.com/repeale/fp-go/lambda" ) func TestUnique(t *testing.T) { // Test : get unique values res := Unique(lambda.Identify[int])([]int{1, 2, 3, 3}) if len(res) != 3 { t.Error("Unique should...