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, with its Go-syntax form as a tie-break. 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.