github.com/alloyzeus/go-azfl@v0.0.0-20231220071816-9740126a2d07/azob/equatable.go (about)

     1  package azob
     2  
     3  // Equatable defines the requirements for implementations so that they can
     4  // be compared for value-based equality.
     5  //
     6  //TODO: generics
     7  type Equatable interface {
     8  	// Equals returns true if the other value matches this object perfectly.
     9  	//
    10  	// Note that value objects are defined by their attributes; even if the
    11  	// types have different names, two value objects are equal if both
    12  	// have the same attributes.
    13  	Equals(interface{}) bool
    14  
    15  	// Equal should be redirected to Equals. This method is required
    16  	// to make all implementations conform the equality interface
    17  	// needed by github.com/google/go-cmp .
    18  	Equal(interface{}) bool
    19  }