github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/predicate/not/api.go (about) 1 // Package not provides negalive predicate builders like 'not equals to' 2 package not 3 4 import ( 5 "github.com/m4gshm/gollections/predicate" 6 "github.com/m4gshm/gollections/predicate/eq" 7 ) 8 9 // Eq - not.Eq makes reverse of the eq.To predicate 10 func Eq[T comparable](v T) predicate.Predicate[T] { 11 return predicate.Not(eq.To(v)) 12 } 13 14 // Match - not.Match alias of predicate.Not 15 func Match[From, To any](getter func(From) To, condition predicate.Predicate[To]) predicate.Predicate[From] { 16 return predicate.Not(predicate.Match(getter, condition)) 17 }