title: In golang why I can't use the struct as nested struct type?
body: <p>The following code (<a href="http://play.golang.org/p/Uwr_TzM5OB" rel="nofollow">play</a>):</p>
  
  <pre><code>func main() {
      buf := bytes.NewBuffer(make([]byte, 0))
      rw := bufio.NewReadWriter(bufio.NewReader(buf), bufio.NewWriter(buf))
      var r *bufio.Writer
      r = rw
  }
  </code></pre>
  
  <p>Gives the following compile-time error:</p>
  
  <pre><code>cannot use rw (type *bufio.ReadWriter) as type *bufio.Writer in assignment
  </code></pre>
  
  <p>What I expected is use a struct as a nested struct type. But if I declare <code>r</code> as <code>io.Reader</code>, this will be ok, so should I move to interface?</p>