internal/fmtsort (on golang.org and go.dev)
imports 2 packages, and imported by 2 packages
Involved Source Files
Exported Type Names
Sort accepts a map and returns a SortedMap that has the same keys and
values but in a stable sorted order according to the keys, modulo issues
raised by unorderable key values such as NaNs.
The ordering rules are more general than with Go's < operator:
- when applicable, nil compares low
- ints, floats, and strings order by <
- NaN compares less than non-NaN floats
- bool compares false before true
- complex compares real, then imag
- pointers compare by machine address
- channel values compare by machine address
- structs compare each field in turn
- arrays compare each element in turn.
Otherwise identical arrays compare by length.
- interface values compare first by reflect.Type describing the concrete type
and then by concrete value as described in the previous rules.
||The pages are generated with Golds v0.1.6-preview. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project and developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.|