Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendJSONKey ¶ added in v1.71.0
AppendJSONKey appends a spelling of v that two values share exactly when JSONEqual holds, NaN apart, so a set of values is searched without comparing every pair. ok is false when v is or holds a value with no such spelling (a struct or a pointer, say), which has to be compared with JSONEqual.
func EqualPtr ¶
func EqualPtr[T comparable](a, b *T) bool
EqualPtr compares two pointers of any comparable type for equality. Both nil returns true, both non-nil with equal values returns true.
func ExactNumber ¶ added in v1.71.0
ExactNumber returns v without rounding, or nil when v is not a number.
func JSONEqual ¶ added in v1.71.0
JSONEqual reports whether a and b are the same JSON value. Numbers compare by value at any depth, since a decoded enum member and a request value need not share a Go type.
func JSONShape ¶ added in v1.71.0
JSONShape returns v as the type a JSON decoder would give back for it, so that a named type, a typed slice or a typed map is held to the same constraints as the plain value, and a nil slice, map or pointer is null. A byte slice is left alone, since JSON writes it as a string. Only the outer value is converted; its members are converted when reached.
Types ¶
This section is empty.