Documentation
¶
Overview ¶
Package cmpx has code that will likely land in a future version of Go, but we want sooner.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶ added in v1.48.0
Compare returns
-1 if x is less than y, 0 if x equals y, +1 if x is greater than y.
For floating-point types, a NaN is considered less than any non-NaN, a NaN is considered equal to a NaN, and -0.0 is equal to 0.0.
func Or ¶
func Or[T comparable](list ...T) T
Or returns the first non-zero element of list, or else returns the zero T.
This is the proposal from https://github.com/golang/go/issues/60204#issuecomment-1581245334.
Types ¶
Click to show internal directories.
Click to hide internal directories.