Definition of sort.Interface

The sort package contains an interface named sort.Interface that allows us to sort slices according to our needs and our data, provided that we implement sort.Interface for the custom data types stored in our slices. The sort package defines the sort.Interface as follows:

Get hands-on with 1200+ tech skills courses.