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.d...@gmail.com> 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+unsubscr...@googlegroups.com.
> 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