Any method can be called as a normal function with the receiver as the first argument. Thus you can call time.Time.Compare(time1, time2) . On Thursday, February 20, 2025 at 9:57:35 AM UTC-8 cpu...@gmail.com wrote:
> Sorry for not finding a better than this click bait subject. > > In https://github.com/golang/go/issues/62642 this suggestion was made: > > slices.SortFunc(times, time.Time.Compare) > > It's totally unclear to me how Time.Compare matches the compare func(a,b > T) int signature? I assume it's something from the golang spec, but which > part? > > Are there other typical uses of this capability that are common? > > Cheers, > Andi > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/e507dac3-e54d-4eeb-86bc-62e8ae7330ben%40googlegroups.com.