A common mistake is treating sort.Interface as a sorting algorithm. It defines the behavior needed to sort an index-based collection while leaving the algorithm and concrete type replaceable. section 2.5.2
type Interface interface {
Len() int #1
Less(i, j int) bool #2
Swap(i, j int) #3
}
Implement Len, Less, and Swap to expose collection size, element ordering, and element exchange. section 2.5.2
Use the abstraction, not the algorithm
Code that depends on sort.Interface can sort different index-based collections without depending on whether the implementation uses merge sort, quicksort, or another algorithm. The same interface also supports utilities such as sort.IsSorted. section 2.5.2

