Got your idea, 3x.

On Tuesday, April 11, 2017 at 5:41:43 PM UTC+8, Jakob Borg wrote:
>
> The int gets boxed into an interface{} as part of the function call, 
> making it equivalent to the other interface{} passed. However: 
>
> https://play.golang.org/p/uxFkrMa_cD 
>
> > On 11 Apr 2017, at 11:32, xjdrew <xj....@gmail.com <javascript:>> 
> wrote: 
> > 
> > package main 
> > 
> > import ( 
> >         "reflect" 
> > ) 
> > 
> > func main() { 
> >         var a interface{} 
> >         a = 5 
> >         b := 5 
> >          
> >         println(a == b) 
> >         println(reflect.TypeOf(a) == reflect.TypeOf(b)) 
> > } 
> > 
> > As the above code show, a is a interface{} associated with a int value, 
> b is int, how can I point out the difference of their type? 
> > 
> > play ground: https://play.golang.org/p/hpbHWLjnms 
> > 
> > 
> > -- 
> > 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...@googlegroups.com <javascript:>. 
> > For more options, visit https://groups.google.com/d/optout. 
>
>

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