On Tue, 2021-01-19 at 21:38 -0800, Ian Lance Taylor wrote:
> On Tue, Jan 19, 2021 at 8:41 PM Dan Kortschak <d...@kortschak.io>
> wrote:
> > 
> > Would that work for non-comparable types? Say the T has an
> > underlying
> > []int type, then the comparison is not against nil and you end up
> > with
> > a panic.
> 
> 
> Fair point.  But I'm not sure what the goal is here.  Perhaps if we
> can define that we can figure out how to make it work.
> 
> Ian

I can see value in it; we use the pattern sometimes of allocating a
slice for a nil destination and returning it or otherwise checking that
lengths match. That pattern would not be possible with this issue. The
use case would be single or double precision float slices. The same
thing happens with maps sometimes too.


-- 
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 on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0cb8abb6dc49bab6743e4817fcef8b1ac0fb1fcc.camel%40kortschak.io.

Reply via email to