Documentation
¶
Overview ¶
Package order sorts values of any type into a stable, human-friendly order, so that printed and encoded sets do not depend on map iteration order.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sort ¶
func Sort[T any](s []T)
Sort sorts s in place.
Integers, unsigned integers and floating-point numbers sort numerically (NaN first), and strings sort lexically. Every other value sorts by its default text form, as printed by fmt.Sprint. Values that still tie, such as an int and an int64 holding the same number, are ordered by their Go-syntax form and then their type name. Values of different kinds, such as in a slice of any, are grouped by kind, so the result does not depend on the input order.
Types ¶
This section is empty.