I found this a little bit non sequitur - if I want to call interface 
function I have a perfect business to check if underlying object is not nil 
before call just to avoid panic on call. Besides underlying nil in 
interface may be used to signal condition for variety of types implementing 
this interface, and since there is no inheritance in Go - sometimes it's 
the only proper way to indicate such condition.

On Monday, June 4, 2012 at 7:54:17 PM UTC-4, Jesse McNelis wrote:
>
> On Tue, Jun 5, 2012 at 8:50 AM, Jonathan Gold <jgol...@gmail.com 
> <javascript:>> wrote: 
> > I'm a bit stumped and wondering if I'm overlooking some way, besides 
> reflection, 
> > to determine whether the data pointed at by an interface{} is actually a 
> nil 
> > pointer: 
>
> You just use a type assertion. If you don't know the type, then you 
> don't know if nil is a valid value for it and thus have no business 
> checking for it. 
>
>
> -- 
> ===================== 
> http://jessta.id.au 
>

-- 
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