On 8 Aug 2017, at 09:06, martin.r...@programmfabrik.de wrote:
> So why not come up with
> func findFirst(slice interface{}, matches func(i int) bool) int
> or so?

For what it's worth, it's not super difficult to implement this function once 
and for all if it's something that would make your life easier. It not being in 
the standard library today doesn't mean it's something you're forbidden from 
doing. The gain is just three lines of trivial code per invocation, but it's 
certainly possible.

Using it is going to be more expensive than the obvious loop so I would be 
surprised to see this function surface in the stdlib. 


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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to