var x interface{} = 7  // x has dynamic type int and value 7
    i := x.(int)           // i has type int and value 7

    type I interface { m() }
    var y I
    s := y.(string)        // illegal: string does not implement I (missing 
method m)
    r := y.(io.Reader)     // r has type io.Reader and y must implement 
both I and io.Reader

I don't understand the comment of the last line. Can someone explain it for 

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 
For more options, visit

Reply via email to