...

/

The sort.Interface Interface

The sort.Interface Interface

Let’s learn about the sort.Interface interface’s functionality.

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:

Access this course and 1400+ top-rated courses and projects.