title: Is there a way to avoid the implementation of the full sort.Interface for slices of structs?
body: <p>If I have an array/slice of structs in Go and want to sort them using the sort package it seems to me that I need to implement the whole sort interface which contains 3 methods:</p>
  
  <ul>
  <li>Len</li>
  <li>Swap</li>
  <li>Less</li>
  </ul>
  
  <p>It seems that Len and Swap should always have the same implementation no matter the type of struct is in the array.</p>
  
  <p>Is there a way to avoid having the implement Len and Swap every time or is this just a limitation from the lack of Generics in Go?</p>