Sort.Search is nice, but then the list has to be sorted. Wasnt there a
lenghty discussion on how awkward sorting is compared to other languages,
and then in 1.8. finally someone implemented
func Slice(slice interface{}, less func(i, j int
<https://golang.org/pkg/builtin/#int>) bool
<https://golang.org/pkg/builtin/#bool>)
which already makes it easier to Sort a slice.
So why not come up with
func findFirst(slice interface{}, matches func(i int
<https://golang.org/pkg/builtin/#int>) bool
<https://golang.org/pkg/builtin/#bool>)
or so?
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.