github.com/machinefi/w3bstream@v1.6.5-rc9.0.20240426031326-b8c7c4876e72/pkg/depends/x/mapx/comparable.go (about)

     1  package mapx
     2  
     3  type Comparable interface {
     4  	string |
     5  		int | int8 | int16 | int32 | int64 |
     6  		uint | uint8 | uint16 | uint32 | uint64 |
     7  		float32 | float64
     8  }
     9  
    10  func Lt[T Comparable](a, b T) bool  { return a < b }
    11  func Let[T Comparable](a, b T) bool { return a <= b }
    12  func Gt[T Comparable](a, b T) bool  { return a > b }
    13  func Get[T Comparable](a, b T) bool { return a >= b }
    14  func Eq[T Comparable](a, b T) bool  { return a == b }
    15  func Neq[T Comparable](a, b T) bool { return a != b }