github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/break/predicate/more/api.go (about) 1 // Package more provides predicate builders 2 package more 3 4 import ( 5 "github.com/m4gshm/gollections/break/predicate" 6 "golang.org/x/exp/constraints" 7 ) 8 9 // Than - more.Than creates a predicate that can be used to test if a value is greater than the expected 10 func Than[T constraints.Ordered](expected T) predicate.Predicate[T] { 11 return func(v T) (bool, error) { return v > expected, nil } 12 } 13 14 // OrEq - more.OrEq creates a predicate that can be used to test if a value is greater than or equal to the expected 15 func OrEq[T constraints.Ordered](expected T) predicate.Predicate[T] { 16 return func(v T) (bool, error) { return v >= expected, nil } 17 }