Documentation ¶
Overview ¶
Package compare provides template functions for comparing values.
Package compare provides template functions for comparing values.
Index ¶
- type Namespace
- func (*Namespace) And(arg0 reflect.Value, args ...reflect.Value) reflect.Value
- func (n *Namespace) Conditional(condition bool, a, b interface{}) interface{}
- func (*Namespace) Default(dflt interface{}, given ...interface{}) (interface{}, error)
- func (n *Namespace) Eq(first interface{}, others ...interface{}) bool
- func (n *Namespace) Ge(a, b interface{}) bool
- func (n *Namespace) Gt(a, b interface{}) bool
- func (n *Namespace) Le(a, b interface{}) bool
- func (n *Namespace) Lt(a, b interface{}) bool
- func (n *Namespace) Ne(x, y interface{}) bool
- func (*Namespace) Not(arg reflect.Value) bool
- func (*Namespace) Or(arg0 reflect.Value, args ...reflect.Value) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Namespace ¶
type Namespace struct {
// contains filtered or unexported fields
}
Namespace provides template functions for the "compare" namespace.
func (*Namespace) And ¶ added in v0.55.0
And computes the Boolean AND of its arguments, returning the first false argument it encounters, or the last argument.
func (*Namespace) Conditional ¶ added in v0.27.1
Conditional can be used as a ternary operator. It returns a if condition, else b.
func (*Namespace) Default ¶
Default checks whether a given value is set and returns a default value if it is not. "Set" in this context means non-zero for numeric types and times; non-zero length for strings, arrays, slices, and maps; any boolean or struct value; or non-nil for any other types.
func (*Namespace) Eq ¶
Eq returns the boolean truth of arg1 == arg2 || arg1 == arg3 || arg1 == arg4.