Skip to content

Glossary: Algorithms Beyond the Basics in Go

cmp.Compare

Also written: Compare

A Go function that returns a negative number, zero or a positive number depending on how two values order. It is used inside sort functions.

Where the book teaches it

Related terms

slices.SortFuncFunction value