Skip to content

Glossary: Coding Interviews in Go

slices.SortFunc

Also written: SortStableFunc

A Go function that sorts a slice using a comparison function you write, which returns a negative number, zero or a positive number. It lets you sort structs by a field.

Where the book teaches it

Related terms

cmp.CompareSort first