title: How are interfaces represented in Go?
body: <p>I'm reading through two articles right now and am a little confused.</p>
  
  <p>This article - <a href="http://blog.golang.org/laws-of-reflection" rel="nofollow noreferrer">http://blog.golang.org/laws-of-reflection</a> says </p>
  
  <pre><code>&gt; var r io.Reader
  tty, err := os.OpenFile("/dev/tty", os.O_RDWR, 0)
  if err != nil {
      return nil, err
  }
  r = tty
  </code></pre>
  
  <blockquote>
    <p>r contains, schematically, the (value, type) pair, (tty, *os.File).
    Notice that the type *os.File implements methods other than Read; even
    though the interface value provides access only to the Read method,
    the value inside carries all the type information about that value.</p>
  </blockquote>
  
  <p>This other article, says </p>
  
  <blockquote>
    <p>In terms of our example, the itable for Stringer holding type Binary
    lists the methods used to satisfy Stringer, which is just String:
    Binary's other methods (Get) make no appearance in the itable.</p>
  </blockquote>
  
  <p><img src="https://i.stack.imgur.com/chcO3.png" alt="enter image description here"></p>
  
  <p>It feels like these two are in opposition. According to the second article, the variable r in the first extract should be (tty, io.Reader), as that is the static type of r. Instead, the article says that *os.File is the type of tty. If the second example were right, then the diagram in the first example should have all of the methods implemented by the Binary type.</p>
  
  <p>Where am I going wrong? </p>