Filters a slice by excluding elements whose extracted keys match any in the exclude list. Returns an error if the iteratee function fails, stopping iteration immediately.
typeUserstruct{IDintNamestring}users:=[]User{{1,"Alice"},{2,"Bob"},{3,"Charlie"},}filtered,err:=lo.WithoutByErr(users,func(uUser)(int,error){ifu.ID==2{return0,fmt.Errorf("Bob not allowed")}returnu.ID,nil},2,3)// []User(nil), error("Bob not allowed")