You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The stdlib is gradually coalescing around func(T, T) int over func(T, T) bool as the function to compare elements. See slices.CompareFunc for example.
For better or worse, the cmpopts.SortSlices and cmpopts.SortMaps uses Go reflection to call an arbitrary function (since it predates the introduction of Go generics). One benefit of the non-generic API is that we can support both a "less"-like function and a "compare"-like function.