import "v.io/x/ref/internal/reflectutil"
Package reflectutil provides reflection-based utilities.
AreComparable is a helper to call AreComparableTypes.
AreComparableTypes returns true iff a and b are comparable types: bools, strings and numbers, and composites using arrays, slices, structs or pointers.
Compare is a helper to call CompareValues.
CompareValues returns an integer comparing two values. If a and b are comparable, the result is 0 if a == b, -1 if a < b and +1 if a > b. If a and b are incomparable an arbitrary value is returned. Arrays, slices and structs use lexicographic ordering, and complex numbers compare real before imaginary.
func DeepEqual(a, b interface{}, options *DeepEqualOpts) bool
Equal is similar to reflect.DeepEqual, except that it also considers the sharing structure for pointers. When reflect.DeepEqual encounters pointers it just compares the dereferenced values; we also keep track of the pointers themselves and require that if a pointer appears multiple places in a, it appears in the same places in b.
Less is a helper to call LessValues.
LessValues returns true iff a and b are comparable and a < b. If a and b are incomparable an arbitrary value is returned. Cyclic values are not handled; if a and b are cyclic and equal, this will infinite loop. Arrays, slices and structs use lexicographic ordering, and complex numbers compare real before imaginary.
TrySortValues sorts a slice of reflect.Value if the value kind is supported. Supported kinds are bools, strings and numbers, and composites using arrays, slices, structs or pointers. Arrays, slices and structs use lexicographic ordering, and complex numbers compare real before imaginary. If the values in the slice aren't comparable or supported, the resulting ordering is arbitrary.
DeepEqualOpts represents the options configuration for DeepEqual.
Package reflectutil imports 3 packages (graph). Updated 2020-09-08. Refresh now. Tools for package owners.