Skip to content

Glossary: Coding Interviews in Go

cmp.Compare

Also written: cmp package

A function from Go's `cmp` package that returns a negative number, zero or a positive number. That is the kind of result `slices.SortFunc` needs from its comparison function.

Where the book teaches it

Related terms

slices.SortFuncMerge intervals