Returns a duplicate-free version of a slice based on a computed key using an iteratee that can return an error. Stops iteration immediately when an error is encountered. Keeps only the first element for each unique key.
// Error case - stops on first errorresult,err:=lo.UniqByErr([]int{0,1,2,3,4,5},func(iint)(int,error){ifi==3{return0,fmt.Errorf("number 3 is not allowed")}returni%3,nil})// []int(nil), error("number 3 is not allowed")