Documentation
¶
Overview ¶
Package compare facilitates comparisons of any two values according to a set of specifications.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatVerb ¶
func FormatVerb(verb string) formatter
Types ¶
type Comparer ¶
type Comparer interface {
Compare(a, b interface{}) (result Comparison)
}
type Comparison ¶
type Comparison struct {
// contains filtered or unexported fields
}
func (Comparison) OK ¶
func (this Comparison) OK() bool
func (Comparison) Report ¶
func (this Comparison) Report() string
type DeepEquality ¶
type DeepEquality struct{}
DeepEquality compares any two values using reflect.DeepEqual. https://golang.org/pkg/reflect/#DeepEqual
func (DeepEquality) Compare ¶
func (this DeepEquality) Compare(a, b interface{}) bool
func (DeepEquality) IsSatisfiedBy ¶
func (this DeepEquality) IsSatisfiedBy(a, b interface{}) bool
type NumericEquality ¶
type NumericEquality struct{}
NumericEquality compares numeric values using the built-in equality operator (`==`). Values of differing numeric reflect.Kind are each converted to the type of the other and are compared with `==` in both directions. https://golang.org/pkg/reflect/#Kind
func (NumericEquality) Compare ¶
func (this NumericEquality) Compare(a, b interface{}) bool
func (NumericEquality) IsSatisfiedBy ¶
func (this NumericEquality) IsSatisfiedBy(a, b interface{}) bool
type Specification ¶
type TimeEquality ¶
type TimeEquality struct{}
TimeEquality compares values both of type time.Time using their Equal method. https://golang.org/pkg/time/#Time.Equal
func (TimeEquality) Compare ¶
func (this TimeEquality) Compare(a, b interface{}) bool
func (TimeEquality) IsSatisfiedBy ¶
func (this TimeEquality) IsSatisfiedBy(a, b interface{}) bool
Click to show internal directories.
Click to hide internal directories.