Why can't I access this field in an interface?
<p>I am trying to understand interfaces better and am not understanding why <code>s</code> has no field <code>Width</code>. My <a href="http://play.golang.org/p/bVjlY9hfu2" rel="noreferrer">example is here</a>:</p>

<pre><code>package main

import "fmt"

type shapes interface {
    setWidth(float64)
}

type rect struct {
    Width float64
}

func (r *rect) setWidth(w float64) {
    r.Width = w
}

var allShapes = map[string]shapes{
    "rect": &amp;rect{},
}

func main() {
    r := &amp;rect{}
    r.setWidth(5)
    fmt.Println(r.Width)  // this works
    for _, s := range allShapes {
        s.setWidth(7)
        fmt.Println(s.Width) // why not???
    }
}
</code></pre>

<p>Why does <code>r</code> have Width but <code>s</code> doesn't? The exact error I get is:</p>

<pre><code>s.Width undefined (type shapes has no field or method Width)
</code></pre>