We can't expect the return value of Compare to always be -1, 0, or 1 and we should instead be checking for polarity. Golang does not require the return value of a Compare function to always be -1, 0, or 1 and can instead be any number, so this expectation can actually break integrations.
We can't expect the return value of
Compareto always be -1, 0, or 1 and we should instead be checking for polarity. Golang does not require the return value of aComparefunction to always be -1, 0, or 1 and can instead be any number, so this expectation can actually break integrations.